# IP backend reverse proxy problem

**URL:** <https://www.ruby-forum.com/t/ip-backend-reverse-proxy-problem/222006>\
**Category:** NGINX\
**Created:** [August 8, 2012, 11:52pm UTC](https://www.ruby-forum.com/t/ip-backend-reverse-proxy-problem/222006 "2012-08-08T23:52:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [August 8, 2012, 11:52pm UTC](https://www.ruby-forum.com/t/ip-backend-reverse-proxy-problem/222006/1 "2012-08-08T23:52:13Z")

</div>

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 :  
[Nginx/ReverseProxy - Community Help Wiki](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](http://wiki.okira.net/w/Accueil) it display the reverse proxy IP  
(127.0.0.1 or 87.106.165.190).  
Regards.

---

<div class="post-metadata">

**Author:** ![Bertrand\_Caplet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e36b37/32.png) [@Bertrand\_Caplet](https://www.ruby-forum.com/u/Bertrand_Caplet)\
**Post date:** [August 9, 2012, 1:19am UTC](https://www.ruby-forum.com/t/ip-backend-reverse-proxy-problem/222006/2 "2012-08-09T01:19:03Z")

</div>

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](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. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
