[Twisted-web] ReverseProxy subpath

Tommi Virtanen tv at twistedmatrix.com
Wed Jun 1 14:44:58 MDT 2005

Siegmund Fuehringer wrote:
> i would like to setup a reverse proxy, which serves the root of an 
> internal server as '/subpath' of the external server:
> http://external.org/subpath -> http://internal.org/
> but i can't get it to work.
> my current setup requires that the internal server also serves the 
> content as '/subpath':
> root.putChild( 'subpath', ReverseProxyResource( '', 6080, 
> '/vhost/http/external.org:80/subpath' ) )
> is there a way to achieve, what i would like to have?

The full URL needs to be passed to the internal server in order
for it to form correct URLs for redirects and such.

The /vhost/ trick passes scheme ("http"), host ("external.org") and
port (":80"), but not the path. So you need the /subpath there.

There has been talk about alternate ways of doing the same, but
that code does not exist yet.

Just use the /subpath.

More information about the Twisted-web mailing list