httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Werner Schalk <werner_sch...@gmx.de>
Subject [users@httpd] mod_rewrite: Overwriting REMOTE_ADDR with HTTP_X_FORWARDED_FOR
Date Fri, 24 Jun 2005 12:44:32 GMT
Hi,

I would like to use mod_rewrite to overwrite the environment variable 
REMOTE_ADDR with the value of HTTP_X_FORWARDED_FOR because I am using Apache 
2 in a reverse / forward proxy scenario where the original IP address of the 
client is not passed on to the internal Apache server:

Inet -> Server (public IP, Apache 2) -> Internal Server (same system, virtual 
server using Linux vserver - private IP address, Apache 2)

I have posted this several weeks ago but all the solutions did not work for 
me. So I tried this mod_rewrite rule:

RewriteEngine On
RewriteRule ^(.*) [env=REMOTE_ADDR:%{HTTP_X_FORWARDED_FOR}]

What's wrong with them? Whenever I activate them I get a "Bad request" 
response from my web server. 

Any input is greatly appreciated. Thanks a lot.

All the best & thanks,
Werner.

---------------------------------------------------------------------
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