Hi all,

I'm in the process of implementing the Guide's recipe for creating a
light front-end server / mod_perl enabled back-end server in order to
solve a problem with too many database connections being open, but
that's not the problem I'm writing about.

My app doesn't use IPs for state or anything, but just for debugging
purposes, I'm interested in seeing the remote IP in the back-end
server's logs, at least until I know things are running smoothly.

I've successfully compiled Ask's proxy_add_forward module into the
front-end server (Apacke 1.3.9, static build), and the
My::ProxyRemoteAddr handler is running successfully on the mod_perl
back-end server (1.21 btw).

Proxy requests are being handled correctly (I have pages generated with
HTML::Mason on the back-end displaying images only available from the
front end), however, no X-Forwarded-For headers are sent to the back-end
server, and consequently, all I see in the back-end server's logs are
the front-end server's IP.

In order to verify the lack of this key header, I modified the
My::ProxyRemoteAddr handler so that it dumps all of the request headers
to the error_log, as follows (which appears just after the IP check but
before the X-Forwarded-For code from the original handler):

        foreach my $key (keys %{$r->headers_in}) {
                print STDERR "PRA Handler: request header $key = "
                        . $r->headers_in->{$key}."\n";
        }

In the error_log, I see the following, which is normal for
Netscape-generated requests:

PRA Handler: request header Accept = image/gif, image/x-xbitmap,
image/jpeg, image/pjpeg, image/png, */*
PRA Handler: request header Accept-Charset = iso-8859-1,*,utf-8
PRA Handler: request header Accept-Encoding = gzip
PRA Handler: request header Accept-Language = en
PRA Handler: request header Host = my.backend.server:8080
PRA Handler: request header Pragma = no-cache
PRA Handler: request header User-Agent = Mozilla/4.7 [en] (X11; U; Linux
2.2.10 i586)

Looking at the front-end server's /server-info, included in the list of
built in modules, I see:

Module Name: mod_proxy_add_forward.c 
Content handlers: none
Configuration Phase Participation: none
Request Phase Participation: Fixups
Module Directives: none

Looks good to me. My guess is that I'm missing something obvious, but I
can't imagine what. I've checked the list archive for similar problems,
but I can't find examples of anyone complaining about the header not
appearing once the proxy_add_forward module was successfully compiled
into the front-end server.

Any assistance would be greatly appreciated.

Thanks,

-- 
 // 2  Ewan Edwards {e^2}  -=-=-  Web Developer for CSP Internet
//     ----------------------------------------------------------------
\\/ /  mailto:[EMAIL PROTECTED]    4252 Commerce Circle, Victoria, B.C.,
 \\/   http://www.csp.net/        Canada (250) 953-2680, Fax 953-2659

Oh well, no point in steering now.

Reply via email to