You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Philip Mak <pm...@aaanime.net> on 2003/07/18 07:59:45 UTC

mod_accel redirects

Given this server configuration (this is a front-end lightweight
Apache, which uses mod_accel to proxy to a back-end mod_perl Apache):

	ServerName www.shoujoai.com
	ServerAlias shoujoai.com
	AccelPass / http://127.0.0.1:8002/

and given a file called "redir.asp", which contains the following:

	<% $Response->Redirect('http://127.0.0.1:8002/mush/'); %>

And given that I issue the following query to the web server:

	GET /redir.asp HTTP/1.1
	Host: shoujoai.com

and the following response:

	Location: http://www.shoujoai.com/mush/

Is there a way to make mod_accel return "shoujoai.com" instead of
"www.shoujoai.com" when it rewrites the location header there? It's
using the default ServerName, instead of the Host header that the
client requested. This causes problems when cookies is set on an
alternative hostname, but the web browser gets redirected to the main
hostname. Is there a way to make it use the Host header when rewriting
an internal redirection URL?

Re: mod_accel redirects

Posted by gr...@mail.netio.org.
Check UseCanonicalName in Apache config. What you describe is what happens
when this is turned ON and Apache generates a URL that points back to
itself. Try turning this off and see if it makes a difference.

On Fri, 18 Jul 2003, Philip Mak wrote:

> Given this server configuration (this is a front-end lightweight
> Apache, which uses mod_accel to proxy to a back-end mod_perl Apache):
>
<snip>

> 	GET /redir.asp HTTP/1.1
> 	Host: shoujoai.com
>
> and the following response:
>
> 	Location: http://www.shoujoai.com/mush/