httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Temme <>
Subject Re: [users@httpd] self-referential URL's and load balancer
Date Sat, 17 Jun 2006 17:17:11 GMT
Hi enigma,

On Jun 12, 2006, at 1:53 PM, enigma wrote:

> I have a problem with the self-referential URL's being generated by  
> Apache
> when a hardware load balancer is front ending it.

This is a well-known problem with load balancing and SSL offload in  
front of any web server. The httpd simply doesn't know that HTTPS  
exists in front of it, and can not generate the correct Location:  
headers for Redirect responses.

Some load balancers have built-in fixups for outgoing response  
headers. You can use those to repair the Location: headers as they  
are sent to the browser. See your load balancer documentation,  
support community or your favorite SE to set this up.

Which version of Apache are you using on which platform? The trunk of  
Apache now has support for setting the scheme in the ServerName  
directive, so you can go


with optional port. You can see the code at:

That should go a long way towards fixing your issue, especially if   
everything you do happens inside the web server. And, any module that  
plays nice and calls the http_scheme hook should get the correct  

I have proposed to backport this to Apache 2.2, and a version of the  
patch that applies to the 2.2.x  branch is at:

Unfortunately, httpd 1.3 hardcodes this scheme information so this  
approach will not work. the EAPI patch at least makes it settable,  
but you only have that if you have mod_ssl.

> I have tried setting UseCanonicalName Off without success. I can  
> remap the
> port with the port directive, but it still changes the https to http.

UseCanonicalName Off should help with the port value, but not the  

You mention the Port directive, which disappeared in httpd 2.0 so  
that means you're using 1.3. As I said, the ServerName [scheme://] 
hostname[:port] code does not work with that version, so unless you  
can upgrade you'll have to fix this on the Load Balancer.


PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

View raw message