Welcome! Log In Create A New Profile

Advanced

LoadBalancing with ip_hash, only hitting one backend server

Posted by nginjames 
LoadBalancing with ip_hash, only hitting one backend server
May 09, 2017 07:06PM
Hello!

Im trying to get a solid load balancing solution in place that can rotate servers and keep sessions per IP. I like NGINX's setup so I first came here to get this done but am having an issue with requests only hitting one of the backend servers when I have ip_hash enabled. Ive gone through the access.logs and show a unique IP on each request, but each request only goes to the first server I have on the list. If I remove ip_hash, the request's round robin properly and I get a different server each time. However, when I add ip_hash and have everyone in the office try the site, they all just pull up the first server.

Am I missing something here? Is it not hashing via the local system IP and only through the external WAN IP?

Thanks in advance for your time to consider this issue.
Re: LoadBalancing with ip_hash, only hitting one backend server
May 10, 2017 02:51AM
Hashing means in this case "ip ranges divided in blocks", so your LAN most likely is considered one block.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: LoadBalancing with ip_hash, only hitting one backend server
May 10, 2017 12:49PM
Gotcha -- that makes sense. When I tried to access it from a different subnet, everything worked.

Thanks!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 59
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