perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "cfaust-dougot" <>
Subject $r->connection->remote_ip with proxy and non proxy env
Date Mon, 06 Oct 2008 15:51:39 GMT
I'm guessing this has been answered but I couldn't find it.
We need to do some IP checking and need to support it on both a load balanced environment
and in a dedicated machine setup.
In the load balanced situation $r->connection->remote_ip returns 1 - Is that correct
and consistent so I can use it to switch between how I get the IP address?
In other words should I be doing something like
if ($r->connection->remote_ip == 1)
  my $ip = $r->headers_in->{'X-Forwarded-For'}
} else {
  my $ip = $r->connection->remote_ip;
Or is there a better way?

View raw message