Apache reverse proxy to serve local folder

Apache reverse proxy to serve local folder

am 05.07.2007 08:22:57 von MrHyde

Hi,

I'm not sure whether this is possible or not. I've looked around, but
have not found anything so far. I've got an apache server installed
that currently runs purely as a reverse proxy. It has a number of
virtual hosts defined that proxy the requests to a number of backend
systems. A default has also been set up to proxy requests to another
server.

A sample of how the server is setup is as follows

http://www.xyz.com ---- > http://realwebserver.xyz.com/rootfolder
http://mail.xyz.com ----> http://realmailserver.xyz.com/mail
http://random.xyz.com ----> http://realwebserver.xyz.com/rootfolder

Now a requirement has come up for this particular apache server to
also serve content. I have not been able to get this to work. I
can't setup a new virtual host to go back to itself as that would put
it in a loop. I can't go directly to the proxy as the default
settings would forward the request to the other server.

If I try to go to http://proxy.xyz.com/test the request is forwarded
to http://realwebserver.xyz.com and comes back with a 404 error.
There must be a way to somehow say, forward everything except requests
for proxy.xyz.com/test which will be served locally.

Any help?

Regards
Vivek

Re: Apache reverse proxy to serve local folder

am 05.07.2007 09:00:33 von unknown

Post removed (X-No-Archive: yes)

Re: Apache reverse proxy to serve local folder

am 05.07.2007 11:58:24 von MrHyde

On Jul 5, 5:00 pm, Davide Bianchi
wrote:
> On 2007-07-05, MrHyde wrote:
>
> > that currently runs purely as a reverse proxy. It has a number of
> > virtual hosts defined that proxy the requests to a number of backend
> > systems. A default has also been set up to proxy requests to another
> > server.
> > Now a requirement has come up for this particular apache server to
> > also serve content.
>
> I could point out that if the server was designed as a reverse proxy
> only, having him serving content is also a misuse of the resource.
> But if you have a number of vhosts that are working, just define another
> vhost with a DocumentRoot and not a Proxy/ProxyPass directive.
>

I agree with you 100%. My preference would have been to serve these
documents from another server, but they must be served from the proxy
server itself. I considered started another instance of apache to
serve these files and have the reverse proxy forward to that, but that
just seems a stupid way to go.

Thank you very much for your help. Setting DocumentRoot worked a
treat.

Cheers,
Vivek

Re: Apache reverse proxy to serve local folder

am 05.07.2007 12:55:46 von unknown

Post removed (X-No-Archive: yes)