Hi I am using nginx as a load balacer and I require sticky session (same client always go to the same server), for this purpose I use this following setup:
upstream backend {
ip_hash;
server host1:8000;
server host2:8000;
}
The `ip_hash` directive is what I learned from online docs, but I am just wondering does this mean that all the requests from the same host will be routed to the same upstream server? Since I may have multiple clients running on the same host, I want to still distribute these requests to different upstream servers but if I am using ip_hash does that imply if two clients are on the same host they will be routed to the same server because they share the same ip? There seems to be some more advanced configs to achieve sticky session but seems that would require nginx plus which I dont have... My intention is that even if two clients come from same host they should probably go to different server, but after they are assigned an upstream server they should stick to that one. Thanks!