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

Phil Mayers p.mayers at imperial.ac.uk
Mon Sep 11 14:56:35 EDT 2006


Markus Schiltknecht wrote:
> 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?

You need a vhostmonster

http://twistedmatrix.com/projects/web/documentation/howto/using-twistedweb.html#auto21




More information about the Twisted-Python mailing list