I am running NGINX as a reverse proxy for the Socket.IO server, which loads balance requests across multiple cluster processes. Each of the cluster processes is invited to listen on different ports.
The nginx server is configured to load balance based on the IP hash, but I get the message:
ws://{domain}/socket.io/?EIO=3&transport=websocket&sid=KaU3C8caGVK4gU1LAAAB failed: WebSocket is closed before the connection is established.
In my nginx configuration there is:
http { {+ default configs} upstream io_nodes { ip_hash; server 127.0.0.1:3000; server 127.0.0.1:3001; server 127.0.0.1:3002; server 127.0.0.1:3003; } }
default vhost:
server { #listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default ipv6only=on; ## listen for ipv6 root /usr/share/nginx/www/static/web; index index.html index.htm; # Make site accessible from http:
Any help would be greatly appreciated. If I started the nodejs server without a cluster, it behaves correctly, the link that I used for this setting is found at: http://socket.io/docs/using-multiple-nodes/ .
thanks
source share