Re: proxypass-reverse question for redirects

Giganews Newsgroups
Subject: Re: proxypass-reverse question for redirects
Posted by:  tevolo (tevo…
Date: Fri, 3 Jun 2011

On May 3, 10:34=A0am, john <joe.…> wrote:
> Hi, somebody any idea how to do the following:
> I have a vmware image running some stupid non-apache webserver on
> From outside I have written a proxypass and proxypassrever=
> to refer to it as follows:
> proxypass /foohttp://
> proxypassreverse /foohttp://
> A request tohttp://myserver/fooworks. However this server will proceed
> with a redirect reply
> to /intranet for the next page. This results on the outside to a request
> for:http://myserver/intranetwhich doesn't exist of course. The same with
> multiple other pages and links. Unfortunately it's not easy to move the f=
> server pages to something likehttp://fooserver/foopages/, because this
> image is using an aolserver with tcl :-(
> Is there a way to handle all redirects from this internal server to a
> correct request?Some nasty rewriterule or whatever.
> John

This is always a pain when doing proxies to pages with hard links to
directories, i.e /intranet.
The easiest way is if you can modify your vmware server to add the /
foo in front of it's directory calls.
If not then you have to start doing rewrite rules grabbing the
directory coming from the vm server, /intranet and rewrite that to /
foo/intranet and end the rewrite rule with the P flag for proxy. This
would have to be done on all of them though :|
What I am not sure though is is this apache server just doing the
proxy and not serving your own content?  if so you may be able to
redirect everything using a ^(.*) type rewrite rule with the proxy
flag and just skip the proxypass request all together. you still need
the reverse proxypass rule though. If you are serving other content
you may need to either block it from the rewrite with a rewrite
conditional statement or a dummy rewrite rule that doesnt do anything
but uses flag L for last. ( not good to have too many rewrite rules
for performance issues)

I have some examples of this somewhere if you need more help.



In response to

proxypass-reverse question for redirects posted by john on Tue, 03 May 2011