[Twisted-Python] HTTP 302 instead of just delivering the content.

Markus Schiltknecht markus at bluegap.ch
Mon Sep 11 06:35:44 MDT 2006


Hi,

I'm using twisted-web on port 8083 and apache as a reverse proxy on port 
80. I can connect to my domain on port 80 and the HTTP request gets 
forwarded to twisted correctly. Twisted also replies and I get the website.

But as soon as I click a link, the 8083 port appears in the URL. And 
according to tcpdump, it also got transfered via 8083. I figured Twisted 
replied with the following (my real domain replaced by some 'x'):

HTTP/1.1 302 Found
Date: Mon, 11 Sep 2006 12:22:57 GMT
Server: TwistedWeb/2.4.0+r17646
Content-type: text/html; charset=UTF-8
Location: http://www.xxxxxxxx.ch:8083/firma/
Transfer-Encoding: chunked

Why does it do that? The request sent was:

GET /firma HTTP/1.1
Host: www.xxxxxxxxx.ch
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.6) 
Gecko/20060728 Firefox/1.5.0.6 (Debian-1.5.dfsg+1.5.0.6-4)
....

The apache2 reverse proxy configuration part is:

RewriteRule ^(.*)$ http://localhost:8083$1 [P]

ProxyRequests Off
ProxyPreserveHost On

ProxyVia Off

<Proxy *>
	Order deny,allow
	Allow from all
</Proxy>


How can I tell twisted to not only accept requests on port 8083, but 
also serve those with Host: www.xxxxxxxxx.ch?

Regards

Markus




More information about the Twisted-Python mailing list