[users@httpd] mod_rewrite: Overwriting REMOTE_ADDR with HTTP_X_FORWARDED_FOR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux