Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Clicktrack + Reverse Proxy configs...

Quote Reply
Clicktrack + Reverse Proxy configs...
I've noticed that my clicktrack table holds only 127.0.0.1's as IP's so I guess my reverse proxy conf is to blame. Question, what ENV should I use to determine the IP of the requesting client? in a LSQL proxy configuration?

Thanks,
Quote Reply
Re: [jaltuve] Clicktrack + Reverse Proxy configs... In reply to
I guess this is mod_perl.

In your startup.pl, put
Code:
use Apache::Constants ();
sub My::ProxyRemoteAddr ($) {
my $r = shift;

# we'll only look at the X-Forwarded-For header if the requests
# comes from our proxy at localhost
return Apache::Constants::OK
unless ($r->connection->remote_ip eq "127.0.0.1")
and $r->header_in('X-Forwarded-For');

# Select last value in the chain -- original client's ip
if (my ($ip) = $r->headers_in->{'X-Forwarded-For'} =~ /([^,\s]+)$/) {
$r->connection->remote_ip($ip);
}

return Apache::Constants::OK;
}
Then, in your modperl.conf file, put
Code:
PerlPostReadRequestHandler My::ProxyRemoteAddr
I hope that helps.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Clicktrack + Reverse Proxy configs... In reply to
Thanks, it is mod_perl (at least for voting related scripts) search in my setup uses fastcgi.

worked fine thanks....

Last edited by:

jaltuve: Aug 20, 2003, 1:25 PM
Quote Reply
Re: [yogi] Clicktrack + Reverse Proxy configs... In reply to
Hi Yogi,

Thankls for providing a solution for this at the time.

Any chance you know how to make this work when using FastCGI instead if mod_perl?