IP backend reverse proxy problem

Francis Daly francis at daoine.org
Wed Aug 8 23:18:42 UTC 2012


On Wed, Aug 08, 2012 at 11:51:20PM +0200, Bertrand Caplet wrote:

Hi there,

> Hi, I've installed nginx as a reverse proxy with 2 backends web servers
> (one nginx, one apache). I want the backends servers to have the "real"
> IP of the client on their logs and on the webpage.

The backend servers will always see the tcp connection coming from the
nginx reverse proxy.

All nginx can do is send an extra http header which says what the ip
address of the client connecting to it was. The backend server can then
choose to do something special with that header, or not.

> I tried
> proxy_set_header like here :    
> https://help.ubuntu.com/community/Nginx/ReverseProxy and apache with the
> rpaf module but it doesn't work...

Look at the traffic from nginx to the backend server. If you see

  X-Real-IP:

and the client address, your nginx configuration is correct. If not,
it isn't.

If your nginx configuration is not correct, provide details. If it is
correct, you have a non-nginx problem to address.

Good luck with it,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list