[Twisted-web] Twisted and reverse proxies

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Wed Mar 31 18:03:01 EDT 2010

On 01:50 am, rgacote at appropriatesolutions.com wrote:
>The one small issue we've had is that all the log entries in Twisted 
>come out showing a source IP of (i.e., the Apache server). We 
>turned on the X-Forwarded headers in Apache and ended up hacking some 
>library code in Twisted, but always figured we must have missed 
>something since it seems that grabbing the X-Forwarded header should 
>either a) be something Twisted would do; or b) have a simple setting to 
>indicate the use of X-Forwarded. (perhaps some more knowledgeable 
>person will point me in the right direction.)

This is a poor behavior of Twisted Web logging, and something I'd very 
much like to see fixed.  Since the better header handling code appeared 
in Twisted 8.2 or so, and since the Twisted Web proxy itself is again 
apparently working in Twisted 10.0, this is probably more feasible to 
actually fix.

http://twistedmatrix.com/trac/ticket/1468 is the ticket for this. 
Notice that I said I was going to work on it a while ago, but then ran 
into the various issues above, and never got anywhere.  Possibly with 
those roadblocks out of the way, the plan I described there could be 
attempted (and perhaps it will even turn out to be a good one, but no 


More information about the Twisted-web mailing list