Re: mod_proxy ProxyPassReverse incorrectly adjusting Location header in redirect?

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

 



Rainer Frey <rainer.frey <at> inxmail.de> writes:
> So the result of ProxyPassReverse will *always* be a URL within the current 
VHost, but you need to send a
> redirect to your other, non-SSL VHost.
> 

> Another idea is using mod_headers to process the Location header in the proxy 
response. But I'm not sure
> that will work, depending on how Apache will chain mod_proxy and mod_headers 
in that case.

> This is the misunderstanding. The URL as second argument to the 
ProxyPassReverse directive is *not* used
> in the response in any way, it is only used to match a location header 
returned by a proxy backend to
> determine if and what to replace. The replacement is always the current host 
URL.


Excellent, you pinpointed my confusion exactly.  I misunderstood
ProxyPassReverse to be a URL rewriting rule for the response
headers, including the protocol part of the URL.  I went and
played with the mod_proxy source to see what actually happens and
saw that the protocol to use in fixing the Location header is
determined by ap_http_scheme(), not from what is listed in the
ProxyPassReverse directive.  Without delving deeper into the
code, I assume this is what you are explaining to me, that the
protocol will always be that of the current VHost.

In my case, since I am reverse-proxying the entire site, I can just remove the 
ProxyPassReverse directives and use mod_headers like you suggest, globally 
applying

   Header edit Location internal.example.com www.example.com

This is working great.


Thanks very much for helping me get straightened out!

Charlie


---------------------------------------------------------------------
To unsubscribe, e-mail: users-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