Welcome! Log In Create A New Profile

Advanced

ip_hash and real_ip_header

Laurence Rowe
January 25, 2010 06:26PM
Hi,

I've got Nginx 0.7.64 running as a loadbalancer / transformation proxy
behind varnish. I'd like to use ip_hash so users get the benefit of
session affinity on my app servers. Though I seem to have
real_ip_header setup correctly ($remote_addr is correct as shown by
X-Real-IP on my app servers), all the requests end up using only a
single app server. Here's the relevant parts of my config:

http {
....
set_real_ip_from 127.0.0.1;
real_ip_header X-Forwarded-For;
....
upstream backend {
ip_hash;
server 127.0.0.2:5011;
server 127.0.0.2:5012;
}
....

Should this work?

Laurence

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

ip_hash and real_ip_header

Laurence Rowe January 25, 2010 06:26PM

Re: ip_hash and real_ip_header

Eugaia January 25, 2010 07:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 111
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready