nginx反向代理websocket相关配置
直接看配置
upstream websocket {
#服务器ip
server 127.0.0.1:2348;
}在站点server配置中加入以下代码location /websocket {
proxy_pass http://websocket;#代理到上面的地址去
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}