Re: Reverse Proxy with partial paths possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 30, 2010 at 2:49 PM, Dirk Taggesell
<dirk.taggesell@xxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux