WebSocket connection to 'ws://.../socket.io/?...
failed: Error during WebSocket handshake: Unexpected response code: 400.
Использую nginx
WebSocket connection to 'ws://.../socket.io/?...
failed: Error during WebSocket handshake: Unexpected response code: 400.
Использую nginx
Иногда для Nginx, это помогает:
location / {
proxy_pass http: // localhost: 8080 ;
proxy_http_version 1.1;
proxy_set_header Upgrade $ http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $ host;
}
Вы не дали полный путь запроса. Возможно что-то подобное. В любом случае, решение за location
.
location /socket.io {
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://127.0.0.1:5000/socket.io;
}