HTTP directory redirect not using $host

Bob Ippolito bob at redivi.com
Wed Sep 20 02:31:58 MSD 2006


It seems that the redirection from http://example.com/somedir to
http://example.com/somedir/ does a 302 using the local hostname rather
than the Host header.

I was able to work around the issue using rewrite:
if (-d $request_filename) { rewrite ^(.*[^/])$ http://$host$1/; }

It would be nice if this was fixed in a future release. I looked
around in the source for a bit, but I wasn't able to find exactly what
needs to be changed.

-bob





More information about the nginx mailing list