参考:https://www.nginx.com/blog/websocket-nginx/
nginx 中需要配置如下的选项,就可以支持代理 WebSocket
location /wsapp/ {
proxy_pass http://wsbackend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}