nginx websocket代理配置

hygbuaa 2020-02-26

map $http_upgrade $connection_upgrade {
        default upgrade;
        ‘‘ close;
    }

   upstream linecloudwebsocket {
        server 127.0.0.1:9002;
    }
server{
   listen       80;
   server_name  localhost;    
    location /linecloud/socket {
             rewrite ^/linecloud/socket(.*)$ /$1 break;
            proxy_pass http://linecloudwebsocket;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
        }
}

相关推荐

guoscy / 0评论 2011-03-09

fengziboy / 0评论 2012-02-11