Overriding default 'missing trailing slash' behavior

Melvyn Sopacua mdev at dnr.servegame.org
Thu Dec 24 19:24:34 MSK 2009


Hi,

Is there a way to override the default behavior of how nginx handles directory 
redirecting?
At present is does the equivalent of:
rewrite $scheme://$first_server_name/$request_uri/ permanent

I tried overriding:
location = /software {
	root /path/to/webroot
	rewrite $scheme://$http_host/software/ redirect;
}

But it doesn't even get there, as the log shows a 301 rather then a 302 with 
the wrong host.
This is a problem for me, as the same site should be accessible from within 
and outside the network, using different hostnames. Two of these hostnames 
don't exist outside the network.
-- 
Melvyn Sopacua



More information about the nginx mailing list