Does nginx use the direct client's IP for ip_hash, or does it also observe X-forwarded-for HTTP header to use as the IP address to ip_hash?
For example, in a situation where some clients using a shared proxy server access an nginx load-balancer w/ ip_hash, would all of those clients hash to the same node?
Or would nginx use the X-forwarded-for header to hash them to different nodes?
While this question is quite old and the answer is correct, after some digging to resolve my own load balancing problem I found that there is a newer option to make the client ip based on the X-Forwarded-For or X-Real-IP and when combined with the ip_hash directive it properly balances load using the user's actual IP as the hash.
http://nginx.org/en/docs/http/ngx_http_realip_module.html
From:
http://wiki.nginx.org/HttpUpstreamModule#ip_hash
Also from:
Validating the documentation. It would be pretty easy to modify the code to include data like the XFF.