server { location / { root /usr/share/nginx/html; index index.html index.htm; add_header Cache-Control "public, max-age=0"; try_files $uri $uri.html $uri/index.html $uri/index.htm $uri/ /index.html /index.htm =404; } location ^~ /immutable/ { root /usr/share/nginx/html; expires 1y; } location ^~ /bijlagen/ { root /usr/share/nginx/html; expires 1y; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; try_files $uri @redirect_to_index; internal; } error_page 404 = @handle_404; location @handle_404 { root /usr/share/nginx/html; try_files /404.html @redirect_to_index; internal; } location @redirect_to_index { return 302 /; } }