Project

General

Profile

Passing Remote Adds with Lighttpd In front of Apache 2

Added by about 16 years ago

Hi everyone,

I have recently setup my server with Lighttpd in front of Apache 2 to handle static content and Apache to handle dynamic but unfortunetly since then I can not detect the user ip (with php REMOTE_ADDR) and this has caused some problems. This is the setup in Lighttpd:

$HTTP["host"] =~ "(^|\.)mydomain\.com$" {
$HTTP["url"] !~ "\.(js|css|gif|jpg|png|ico|txt|swf|html|htm)$" {
proxy.server = ( "" => (
( "host" => "127.0.0.1", "port" => 8080 )
)
)
}
}

I would appreciate if you could help me fix this problem.
Thanks


Replies (2)

RE: Passing Remote Adds with Lighttpd In front of Apache 2 - Added by icy about 16 years ago

Look at the X-Forwarded-For header.

RE: Passing Remote Adds with Lighttpd In front of Apache 2 - Added by sj@acts.hu over 15 years ago

mod_rpaf (http://stderr.net/apache/rpaf/) is your friend, and the following apache config will do the trick:

LoadModule rpaf_module /usr/local/libexec/mod_rpaf-2.0.so

RPAFenable On
RPAFproxy_ips 127.0.0.1
RPAFsethostname On
RPAFheader X-Forwarded-For

    (1-2/2)