nginx 配置nodejs服务wss 出现错误wss handshake: Unexpected response code: 400

官网链接:Using NGINX as a WebSocket Proxy

解决方法:

location /wsapp/ {
    proxy_pass http://wsbackend;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

你可能感兴趣的:(nodejs,nginx,http,网络协议,网络)