diff --git a/nginx.conf b/nginx.conf index 12058cd..cc4e535 100644 --- a/nginx.conf +++ b/nginx.conf @@ -42,14 +42,24 @@ http { add_header Content-Security-Policy "default-src 'self'"; + error_page 404 /404.html + + location /404.html { + root /err/; + } + location / { root /usr/share/nginx/html; index index.html; gzip_static on; brotli_static on; error_page 500 502 503 504 /50x.html; - try_files $uri $uri.html $uri/ =404; + try_files $uri.html $uri $uri/ =404; add_header Cache-Control "public, no-transform, max-age=1209600"; + + if ($uri ~* \.html$) { + return 404; + } } location /misc/ { diff --git a/src/routes/err/404/+page.svelte b/src/routes/err/404/+page.svelte new file mode 100644 index 0000000..488e9c4 --- /dev/null +++ b/src/routes/err/404/+page.svelte @@ -0,0 +1,23 @@ + + +
+

There's no light at the end of this tunnel

+

The page you were looking for wasn't found

+

Use the menu bar to try another destination

+
+

Status: 404
Message: NOT_FOUND

+