Welcome! Log In Create A New Profile


ip_hash and multiple clients on the same host

October 30, 2020 11:29AM
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 {
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!
Subject Author Posted

ip_hash and multiple clients on the same host

bobfang_sqp October 30, 2020 11:29AM

Re: ip_hash and multiple clients on the same host

Sergey A. Osokin October 30, 2020 04:48PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 76
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready