nginx and ip_hash: examples/cluster-nginx uses always the same node #3778
-
Hello, The README says: I'm testing the whole setup using multiple clients with different IP addresses but I always end up calling the same node. Any ideas? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That may be due to the fact the From http://nginx.org/en/docs/http/ngx_http_upstream_module.html#ip_hash:
I have updated the example here: https://github.com/socketio/socket.io/blob/master/examples/cluster-nginx/nginx/nginx.conf You can test it with multiple
|
Beta Was this translation helpful? Give feedback.
That may be due to the fact the
ip_hash
only uses the first 3 octets of the client address (xxx.yyy.zzz.0).From http://nginx.org/en/docs/http/ngx_http_upstream_module.html#ip_hash:
I have updated the example here: https://github.com/socketio/socket.io/blob/master/examples/cluster-nginx/nginx/nginx.conf
You can test it with multiple
client
containers and thehash $remote_addr consistent;
directive: