본문 바로가기
Nodejs

socket io 에서 WebSocket connection to 'wss: 오류 발생시

by GoodDev 2018. 1. 16.

NGINX 에서 redirect 시킬 경우 해당 부분에서 오류가 발생한다.


WebSocket connection to 'ws://.../socket.io/?EIO=2&transport=websocket&sid=p3af7ZNfvogtq6tAAAG0' failed: Error during WebSocket handshake: Unexpected response code: 400.


이럴경우 하단의 3개의 Header를 설정시켜 주면 발생하지 않는다.


location / {
..........................
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}

댓글