You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Charlie Katz <ck...@cfa.harvard.edu> on 2012/04/12 16:39:32 UTC
[users@httpd] Re: mod_proxy ProxyPassReverse incorrectly adjusting Location header in redirect?
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org