You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dirk Taggesell <di...@proximic.com> on 2010/06/30 15:49:55 UTC
[users@httpd] Reverse Proxy with partial paths possible
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
---------------------------------------------------------------------
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
Re: [users@httpd] Reverse Proxy with partial paths possible
Posted by Tom Evans <te...@googlemail.com>.
On Wed, Jun 30, 2010 at 2:49 PM, Dirk Taggesell
<di...@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