与Nginx的Websocket握手错误

时间:2017-11-19 18:14:16

标签: node.js nginx socket.io

我在网页中使用Socket.io,但它不起作用。在console.log我收到以下错误:

socket.io.js:2 WebSocket connection to 'ws://www.somewebpage.com/socket.io/?EIO=3&transport=websocket&sid=uoSGxATXKabezBn8AABP' failed: Error during WebSocket handshake: Unexpected response code: 400

我有这个Nginx配置:

location / {
    proxy_pass  http://melo;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
}

我可以检查什么来解决这个问题?

0 个答案:

没有答案