On Mon, Oct 15, 2012 at 8:25 AM, Perrin Harkins <per...@elem.com> wrote:

> On Sat, Oct 13, 2012 at 7:41 AM, pangj <pa...@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

Reply via email to