perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cees Hek <cees...@gmail.com>
Subject Re: X-Forwarded-For
Date Sun, 14 Oct 2012 23:39:05 GMT
On Mon, Oct 15, 2012 at 8:25 AM, Perrin Harkins <perrin@elem.com> wrote:

> On Sat, Oct 13, 2012 at 7:41 AM, pangj <pangj@riseup.net> wrote:
> > In nginx's config file we have added the x-forwarded-for header.
> > With modperl (MP2) how to get this header?
>
> Use headers_in():
> http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_headers_in_
>
>
As an alternative, you could use something like mod_rpaf on your backend
apache server:

http://stderr.net/apache/rpaf/

This will look for an X-Forwarded-For header and if it is from a trusted
proxy server (ie a server specified in your config), it will update the
remote client information that apache sees.  Makes ip addresses in your
access log much more useful, and means you don't need custom code to look
at proxy headers to figure out the real client ip address.

Cheers,

Cees Hek

Mime
View raw message