Index Of -
location / try_files $uri $uri/ =404;
autoindex off; To provide a custom 403 Forbidden page instead of a listing, use: Index of
RedirectMatch 301 ^/$ /home.html In your server block, add: location / try_files $uri $uri/ =404; autoindex off;
When HTTP servers emerged, they copied this model. The creators assumed that if you put a file in a public folder, you wanted people to find it. The index.html file was the exception —a way to override the default listing with a pretty homepage. If you didn't provide that exception, the server assumed you wanted the raw list. location / try_files $uri $uri/ =404