httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Evans <tevans...@googlemail.com>
Subject Re: [users@httpd] Reverse Proxy with partial paths possible
Date Wed, 30 Jun 2010 14:26:10 GMT
On Wed, Jun 30, 2010 at 2:49 PM, Dirk Taggesell
<dirk.taggesell@proximic.com> wrote:
> Hi all,
>
> I run an Apache 2.2.11 for several virtual hosts and I configured
> several reverse proxy directives which are working as intended.
>
> Now I received a request to configure some additional rules, like these:
>
> ProxyPass               /bla/  http://first-back-end:8000/
> ProxyPassReverse        /bla/  http://first-back-end:8000/
>
> ProxyPass               /bla/req http://second-back-end:9200/req
> ProxyPassReverse        /bla/req http://second-back-end:9200/req
>
> While the first one works as intended, the second one is somewhat
> special: it is intended to route requests like this:
>
> http://frontend/req.txt?some=arguments&and=evensomemore
>
> as well as
>
> http://frontend/req.xml?some=arguments&and=evensomemore
>
> to the second backend. And introducing an additional path like
>
> http://frontend/path/req.xml?some=arguments&and=evensomemore
>
> is not allowed, though it would make the whole thing much easier.
>
> Can the desired behaviour being achieved with a simple reverse proxy
> directive? Or would I need ProxyReverseMatch or something?
>
> --
> kind regards
> Dirk Taggesell
>

This should work I think, but you have the order the wrong way around.
Put the most specific path first, the least specific last.

Eg:

ProxyPass /req http://app2/req
ProxyPassReverse /req http://app2/req
ProxyPass / http://app/
ProxyPassReverse / http://app/

Cheers

Tom

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message