Forum Moderators: phranque

Message Too Old, No Replies

ProxyPass with Client-IP address

ProxyPass with Client-IP address

         

heuri

6:35 pm on Apr 21, 2010 (gmt 0)

10+ Year Member



Hello guys,

I'm looking for a way to pass also the Client-IP of the Visitor to the target server.
My actual code is this:

Code:

<VirtualHost #*$!.#*$!.#*$!.#*$!:80>
ServerName test.heremydomain.com
ServerAlias www.test.heremydomain.com
ProxyRequests On
ProxyPass / http://www.heremytargetdomain.com/
ProxyPassReverse / http://www.heremytargetdomain.com/
</VirtualHost>


This code works also, but when I look in the Access-Log of my "heremytargetdomain.com" site, I just see the IP-Address of my Apache-Server.

What I have to do, that I see just the the real client ip and not my server ip?

Thankz a lot!

jdMorgan

8:39 pm on Apr 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to configure the front-end server to pass an X-Forwarded-For header to the back-end. This will contain the remote client's IP address.

On the back-end, use a custom log configuration to log X-Forwarded-For instead of the usual Remote-Host or Remote-Address values.

See the mod_proxy and mod_log_config documentation at apache.org for details.

Jim