Hi Stas, On Yesterday at 9:14pm, SB=>Stas Bekman <[EMAIL PROTECTED]> wrote:
SB> SB> but in apache2 it's built-in and no more requires a mod_perl module SB> for that. I don't have any examples but mod_proxy/mod_headers already SB> provide this functionality from what I've remember seeing on the SB> httpd-dev list. Maybe I'm misunderstanding here, but I did mention (didn't I?) that mod_proxy already adds the X-Forwarded-For header from the front-end server (automatically). So that's not the issue here. SB> SB> Actually, I've just found this example with google (requires SB> mod_headers): SB> SB> RequestHeader set X-Forwarded-For %{REMOTE_ADDR} SB> SB> Does it do the trick? SB> Not really. Unless I'm misunderstanding here again, your recipe above is doing what mod_proxy already does automatically on the front-end server. The back-end server is a whole different issue. The issue at stake is really the back-end server which ends up seeing nothing but 127.0.0.1 in the access_log. By using My::ProxyRemoteAddr, I was able to extract the last IP in the X-Forwarded-For header chain and use that last IP address for the $r->connection->remote_ip($ip) call. This way the "back-end" server would see the real IP server even in the access_log and in all the perl scripts as well without any other finagling. To be really explicit, I have 2 requirements: 1) back-end server should log the client's IP address in the server logs. 2) All the mod_perl scripts on the back-end server should be able to see the client's IP address without taking any extra steps. Regards, -- Haroon Rafique <[EMAIL PROTECTED]> -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html