httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Adam <>
Subject Re: [users@httpd] mod_proxy / mod_rewrite: Passing remote IP address to internal server
Date Wed, 15 Jun 2005 01:32:00 GMT
On Wed, 15 Jun 2005, Werner Schalk wrote:
> I do use mod_proxy as a reverse / forward proxy as follows:
> Inet -> Server (public IP, Apache 2) -> Internal Server (same system, virtual
> server using Linux vserver - private IP address, Apache 2)
> Now all the requests that are send to the public IP address are forwarded to
> the internal server(s). The problem is that the original IP of the remote
> client is not passed to the internal server so for the internal servers it
> looks like the public server is making all the requests. My question now is:
> How can I pass the remote_addr of the client making the request to the
> internal server using mod_rewrite or mod_proxy? I mean I want the IP not only
> to be logable inside the virtual server (with the private ip) but also I
> would like PHP scripts etc. to correctly get the IP's of the remote clients.

Have you tried looking at the X-Forwarded-For header? (Appears in CGI
scripts as HTTP_X_FORWARDED_FOR) This is passed automatically by
mod_proxy, as far as I know.


David Adam

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message