httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] Mod_rewrite proxying source ip address
Date Thu, 27 Jul 2006 13:18:30 GMT
On 7/27/06, Greg Boug <gregb@jumbuck.com> wrote:
> Hi guys,
>
> I'm not sure if this one is possible, I'm attempting to use
> a mod_rewrite rule to proxy to another URL, but for the
> request it proxies to, I need it to keep the original source
> IP address intact. At present, I have something along the
> lines of:
>
> RewriteRule "^/$" http://server.com/startup/now?a=b [P,L,QSA]
>
> Now this works and does what is required, with the exception
> that the request to /startup/now?a=b has the source IP
> address of the apache server where the Rewrite rule exists.
>
> Is there any way that I can pass through the original source
> IP address in a fashion that it will be recognised as the
> remote address? I think we are checking this via the REMOTE_ADDR
> environment variable...
>
> Oh, and one more thing, just to make life a little more fun:
> we can't just use a 30x redirect.

The proxy sends the X-Forwarded-For request header containing the
original IP address.  You can use that on the origin server.  If you
need to lie to the origin server about the REMOTE_ADDR itself, see the
mod_extract_forwarded third-party module.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message