Welcome! Log In Create A New Profile

Advanced

Nginx removes X-Client-IP header added by loadbalancer

December 08, 2012 01:20PM
Hi,

I have a HAProxy running in front of Nginx, and I add 'X-Client-IP' header to reflect the actual IP of the client. If the request is routed directly to the application server (Tornado in my case), this header is present and I can retrieve it with no problem.

However, if the request is first routed to Nginx and then to the application server using:

proxy_pass http://127.0.0.1:8080;
proxy_redirect off;

then the 'X-Client-IP' header is missing from the request when it reaches Tornado. I guess I might need to explicitly add this header in Nginx as well, so it can relay it on. What is the right solution here?
SubjectAuthorPosted

Nginx removes X-Client-IP header added by loadbalancer

mrtnDecember 08, 2012 01:20PM

Re: Nginx removes X-Client-IP header added by loadbalancer

Francis DalyDecember 08, 2012 02:16PM

Re: Nginx removes X-Client-IP header added by loadbalancer

Maxim DouninDecember 09, 2012 07:48PM

Re: Nginx removes X-Client-IP header added by loadbalancer

mrtnDecember 09, 2012 08:30PM

Re: Nginx removes X-Client-IP header added by loadbalancer

Maxim DouninDecember 09, 2012 10:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 116
Record Number of Users: 3 on November 23, 2014
Record Number of Guests: 377 on November 23, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready