server { listen 80; listen [::]:80; server_name localhost; root /usr/share/nginx/html; absolute_redirect off; # disable http://example.org/index as a duplicate content location = /index { return 404; } include redirects.conf; location ~ { index index.html; try_files $uri/index.html $uri $uri.html =404; } error_page 404 =404 /404.html; error_page 403 =403 /403.html; }