HTTP directory redirect not using $host

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

It seems that the redirection from to 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.


More information about the nginx mailing list