location /api/ {
proxy_pass http://127.0.0.1:8585;
...
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
需要配置如上:
proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";
这段话
html中链接webSocket服务请求协议头是ws://



