[Twisted-web] Pastebin behind a ReverseProxyResource

Matt Goodall matt at pollenation.net
Tue Mar 15 15:49:51 MST 2005

On Tue, 2005-03-15 at 12:29 -0700, Jason Mobarak wrote:
> Hi --
> I'm trying to set up the pastebin example from Nevow SVN behind a
> ReverseProxyResource. I have the following tac file [1] setting
> everything up. The doc strings for VHostMonsterResource state that the
> paths on the main site and the proxy site should be the same. For
> example something like "http://foo.com/bar" would be written to
> "http://foo.com:8080/bar", however everything seems to be rewritten
> incorrectly. You can see how everything comes up here [2].
> 1: http://deadbeefbabe.org/dbb.tac.txt
> 2: http://deadbeefbabe.org/paste

The problem is that the pastebin expects to be the root resource. It
loads the CSS and images (if there are any, I can't remember now) from /
and not /paste. To mount the pastebin at /paste you will need to update
it so that it knows that's where it's mounted.

It's not just the pastebin that has this problem. If any app is to be
mounted at /foo then it needs to be written to know that from the start.

However ... a long time ago now, I wrote a simple reroot renderer that
may help with this sort of problem. It's in sandbox/mg/reroot.py. A
macro would be better for this though (see dp's latest macro branch)
because then the reroot would only happen once and not every request.

Cheers, Matt

    /  \__     Matt Goodall, Pollenation Internet Ltd
    \__/  \    w: http://www.pollenation.net
  __/  \__/    e: matt at pollenation.net
 /  \__/  \    t: +44 (0)113 2252500
 \__/  \__/
 /  \          Any views expressed are my own and do not necessarily
 \__/          reflect the views of my employer.

More information about the Twisted-web mailing list