perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jie Gao <J....@sydney.edu.au>
Subject Re: Question about Apache 2.4 and libapreq2 (Apache2::Request)
Date Fri, 10 Mar 2017 08:05:00 GMT
* JW <gava_g@yahoo.com> wrote:

> This mod_perl server is behind a proxy on the same machine. Under Apache 2.2, $r->remote_ip()

> returned 127.0.0.1 and not the user's actual IP.  So, a PerlPostReadRequestHandler extracted
the user's 
> IP address from the X-Forwarded-For header and set it with $r->remote_ip( $ip ).
> 
> In Apache 2.4 (and mod_perl now) $c->remote_ip is split into $r->useragent_ip and
$c->client_ip:
> http://httpd.apache.org/docs/2.4/developer/new_api_2_4.html 
> But, $r->useragent_ip (wrongly) gives me 127.0.0.1. Perhaps this'll be fixed at some
point (unlessI'm doing something wrong). So, for now, as above, the IP is extracted from X-Forwarded-For

> and set with $r->useragent_ip( $ip ). 
> 
> I was asked by one of the earlier responders to share my experience with the move to
Apache 2.4,in case there were others in the same boat. So, if there are, jump right in and
good luck!


You might want to configure mod_remote_ip for this:

RemoteIPHeader X-Forwarded-For
RemoteIPInternalProxy address.of.your.proxy
    or
RemoteIPTrustedProxy address.of.your.proxy

Regards,


Jie


Mime
View raw message