[dev] SERVER_NAME:SERVER_PORT and UseCanonicalName in Apache conflict

Jon Parise jon@horde.org
Mon, 12 Nov 2001 10:28:02 -0500


On Mon, Nov 12, 2001 at 03:13:13PM +0000, Barry Flanagan wrote:

> In line 280 of lib/Horde.php, you are specifically building the redirect
> URLs based on the reported SERVER_NAME and SERVER_PORT variables.
> 
> This causes a problem in a set up like ours where we use front-end load
> balancers which map (say) port 80 for a specific external IP to an arbitrary
> internal host/port of our choosing.
> 
> As it happens, our IMP installation is running on ports 81 and 444. Apache
> handles redirects perfectly by using 'UseCanonicalName Off', thus building
> URLs based on the client-supplied HTTP_HOST variable alone (i.e.
> 'http://mail.online.ie'). However, Horde RC1 is sending back
> 'http://mail.online.ie:81' which does not exist in the world outside our
> internal network.
> 
> Is there any real need for Horde to be building these redirect URLs as
> opposed to the web server? I can see this affecting Virtual Host setups
> where the SERVER_NAME (which is server wide) is NOT where the redirect
> should be pointed, which would more likely want to be HOST_NAME.
 
We need the ability to generate absolute URLs for things like the
Location: headers were use for redirection.

Aside from not generating URLs in PHP land, what would you
suggest for fixing this?  Is there another environmental variable
we should be using?

-- 
Jon Parise (jon@csh.rit.edu)  .  Information Technology (2001)
http://www.csh.rit.edu/~jon/  :  Computer Science House Member