"response code: 502" using socket.io and nginx 1.4.x (stable) with proxy_pass -
i trying make running app (using socket.io) under nginx, , websocket connection 'ws://...' failed: unexpected response code: 502
error on server side. have read nginx suport websockets since v.1.3
have upgrade nginx v1.4.1 (stable)
.
here conf:
server { listen 80; server_name website.com; location / { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection "upgrade"; access_log /var/log/nginx/website/access.log; error_log /var/log/nginx/website/error.log; } }
update:
i have can reach app (so listen port 3000) , socket.io working unless error, in cases, emit
call desn't send arguments undefined
.
what missing here avoid error?
i have found avoid error:
io.set('transports', ['xhr-polling']);
so socket.io ajax calls, job way more slowly, if has real key issue still interested!
Comments
Post a Comment