[mod_python] mod_python or wsgi

Graham Dumpleton graham.dumpleton at gmail.com
Fri Jul 11 06:17:23 EDT 2008

2008/7/11 Sean Allen <sean at monkeysnatchbanana.com>:
> On Jul 10, 2008, at 10:07 PM, Graham Dumpleton wrote:
>>> We have one PostReadRequestHandler
>>> All the rest of RequestHandlers
>>> The PostReadRequestHandler does some across the board setup including
>>> setting
>>> the remote_ip in the connection to the value of X-Forwarded-For, if said
>>> header exists and if the connection is being proxied.
>> Is that something which could be done by mod_headers or one of the
>> other modules available for fiddling with headers?
>> Graham
> Well, the entire idea is that in mod_perl the remote_ip returns
> and the X-Forwarded-For header has the actual real value. The
> PostReadRequestHandler
> corrects that so that code doesnt need to know if it is being proxied to or
> not.
> So that is a bit beyond what mod_headers does. I take it from the question,
> this could be an issue?

Hmmm, you do realise though that the client IP cannot even really be
relied upon? For example, large ISPs often have all traffic from that
IP appearing as same client IP. This can often cause problems for
session based mechanisms which use client IP address in some way.

Anyway, it isn't really a problem at all if you are using WSGI, as
that sort of transformation can be done as WSGI middleware, given that
that change is only targeting your application content provider and
not any other phases of Apache.


More information about the Mod_python mailing list