httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charlie Katz <>
Subject [users@httpd] Re: mod_proxy ProxyPassReverse incorrectly adjusting Location header in redirect?
Date Thu, 12 Apr 2012 14:39:32 GMT
Rainer Frey <rainer.frey <at>> 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 

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 

   Header edit Location

This is working great.

Thanks very much for helping me get straightened out!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message