Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl
$r->connection->remote_ip with proxy and non proxy env
 

Index | Next | Previous | View Flat


cfaust at doyougot

Oct 6, 2008, 8:51 AM


Views: 417
Permalink
$r->connection->remote_ip with proxy and non proxy env

Folks,

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?

TIA!
-Chris

Subject User Time
$r->connection->remote_ip with proxy and non proxy env cfaust at doyougot Oct 6, 2008, 8:51 AM
    Re: $r->connection->remote_ip with proxy and non proxy env fred at redhotpenguin Oct 8, 2008, 10:06 AM
        Re: $r->connection->remote_ip with proxy and non proxy env jansen at hbz-nrw Oct 9, 2008, 12:23 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.