阿里云SLB配置WSS服务

failed: Error during WebSocket handshake: Unexpected response code: 502

WebSocket connection to ‘wss://socket01.xxx.com/’ failed: Error during WebSocket handshake: Unexpected response code: 400

WebSocket connection to ‘wss://socket01.xxx.com/’ failed: Error during WebSocket handshake: Unexpected response code: 200

前端监听协议https,后端监听协议http
443监听,转80,添加转发策略
然后nginx.conf里server
location /websocket {
proxy_pass http://127.0.0.1:9502;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “Upgrade”;
}

Leave Comment

电子邮件地址不会被公开。 必填项已用*标注