Beginner's question: redirecting /dir/index.html to /dir/

ez77 nginx-forum at
Fri Sep 10 20:51:52 MSD 2010

Thank you all for your replies. It's indeed an honor to receive help
from the very creator of nginx! Not meaning to bug any of you any
more... but this last configuration,

location / {
root /var/www/mysite;
index index.html;

location ~ ^(/.+/)index.html$ {
error_page 404 http://$host$1?;

, redirects to the root of my site: instead of
To be precise, to . (What's the point of that "?"?)

Thank you again,


Posted at Nginx Forum:,128951,129247#msg-129247

More information about the nginx mailing list