Re: mod_proxy not handling redirects correctly

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

 



Hi,

Dani Pardo wrote :
>  Hi all, I have an environment in which I reverse proxy some servers
> depending on the value of a cookie, that is:
> 
>         RewriteCond %{HTTP_COOKIE} ^.*destination_host=host1.*$
>         RewriteRule (.+) http://www.host1.com$1 [P]
>         RewriteCond %{HTTP_COOKIE} ^.*destination_host=host2.*$
>         RewriteRule (.+) http://www.host2.com$1 [P]
> 
>  The idea is that I reverse proxy everything to either www.host1.com
> or www.host2.com depending on the value of the cookie
> "destination_host".
>  That's working correctly at the moment, the problem comes when the
> target (host1 or host2) sends a redirect, which doesn't get reverse
> proxied, and thus the browser goes directly to www.host1.com or
> www.host2.com.

You should add both ProxyPassReverse :

	ProxyPassReverse / http://www.host1.com/
	ProxyPassReverse / http://www.host2.com/

it will do the trick.

Regards,

-- 
Charles Goyard - charles.goyard@xxxxxxxxxxxxxxxxxx - (+33) 1 45 38 01 31
Orange Business Services - online multimedia  // ingénierie

---------------------------------------------------------------------
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