Am Mittwoch, den 08.10.2008, 10:06 -0700 schrieb Fred Moyer:

> You could also do something like:
> 
> if (my $ip = $r->headers_in->{'X-Forwarded-For'}) {
> 
>      $r->connection->remote_ip( $ip );
> }

But (as I learned the hard way long ago) you should check the value of
the X-Forwarded-For header: On its way to you the request might have
passed other proxys which could also have contributed to that header
(putting anything in there from internal IPs to the string
"unknown"...).
IIRC, a frontend Apache proxy on your side appends (not prepends) the
remote ip it saw to the header (separated by ", ").

Heiko

Reply via email to