Welcome! Log In Create A New Profile

Advanced

Re: Stud -> Haproxy -> and Nginx; nginx real_ip_header isn't working as expected, can't scale

Francis Daly
August 31, 2012 06:36PM
On Fri, Aug 31, 2012 at 11:32:13AM -0700, Thompson, Paige wrote:

Hi there,

> I only have one load balancer at the moment, but given the addition of
> a second or third in which I cannot rely on all of the ip addresses to
> be expressible any other way than 0.0.0.0/24.
>
> set_real_ip_from 10.0.0.0/24;

You've used two different cidr addresses there. It's not clear which
one you actually mean.

Are you aware that 10.0.0.0/24 means "10.0.0.anything"?

If you want "10.anything", that is 10.0.0.0/8.

> real_ip_header X-Forwarded-For;
>
> This simply does not work, however if I put a single load balancers IP
> address there, it does.

It looks to me like it should work.

And a quick test of

curl -i -H 'X-Forwarded-For: 10.0.1.99' http://localhost:8080/

shows "10.0.1.99" as the first field in access.log.

What does your set_real_ip_from directive say? And what is the IP address
of the load balancer that is talking to nginx?

I suspect that when you configure it right, nginx will work fine.

Good luck with it,

f
--
Francis Daly francis@daoine.org

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

Stud -> Haproxy -> and Nginx; nginx real_ip_header isn't working as expected, can't scale

Thompson, Paige August 31, 2012 02:34PM

Re: Stud -> Haproxy -> and Nginx; nginx real_ip_header isn't working as expected, can't scale

Francis Daly August 31, 2012 06:36PM

Re: Stud -> Haproxy -> and Nginx; nginx real_ip_header isn't working as expected, can't scale

Francis Daly August 31, 2012 06:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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