IP backend reverse proxy problem

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. 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…
Hope you’ll have some advices. I just want the backends server to
display the client IP not like right now, have a look :
http://wiki.okira.net/w/Accueil it display the reverse proxy IP
(127.0.0.1 or 87.106.165.190).
Regards.

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 D. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs