[Twisted-Python] Re: Proxy server in front of two web sites

Stefan Arentz stefan.arentz at gmail.com
Mon Oct 29 12:45:59 EDT 2007

The problem is that I don't have control over these servers. Otherwise
I would have implemented the redirect.

I've done a quick hack where I have a Resource that deals with this
directory hierarchy and simply starts a client.getPage to retrieve the
page and does a redirect if it does not exist. It works fairly well,
initial tests with 'ab' gives really reasonable performance actually.
Without any optimization or caching :-)


On 10/29/07, Marcin Kasperski <Marcin.Kasperski at softax.com.pl> wrote:
> "Stefan Arentz" <stefan.arentz at gmail.com> writes:
> > I'm looking at implementing a solution for the following problem: I
> > have a setup with two web servers. Each contains the same directory
> > structure but not the same files. Using a proxy server in front of
> > these two I would like to merge them into one. So the proxy would
> > first hit server A and if A returned a 404 then it would hit B.
> >
> > Is this something that I should implement as a web server or as a
> > proxy server? Is there actually a difference?
> Well, de facto it will (almost-*) always be a proxy, proxy is
> something that forwards requests and responses. One thing to note is
> that if you want backend servers to see the client IP, some extra
> effort is needed (like mod_rpaf on backend and adding X-Forwarded-For
> on proxy).
> nginx suggestion is good one, although of course not the only
> possible.  I believe almost every product suitable to work as
> reverse-proxy should handle this use case.
> *) There exists the solution which does not require a proxy (and is
> reasonable if most of the requests go to the first server). Just
> have clients accessing the first server but in error handler redirect
> them to the second server whenever they face 404.  This way one item
> less to manage. But such process will not be transparent for users,
> they will see different URLs.
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

More information about the Twisted-Python mailing list