Add custom 404 page

This commit is contained in:
Fred Boniface 2023-10-02 20:39:00 +01:00
parent b2e507c845
commit 4b48303c4e
2 changed files with 34 additions and 1 deletions

View File

@ -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/ {

View File

@ -0,0 +1,23 @@
<script lang="ts">
import Header from "$lib/navigation/header.svelte";
import Nav from "$lib/navigation/nav.svelte";
const title = "404 - Not Found"
</script>
<Header {title} />
<h1 class="heading">There's no light at the end of this tunnel</h1>
<p>The page you were looking for wasn't found</p>
<p>Use the menu bar to try another destination</p>
<br>
<p class="err_code">Status: 404<br>Message: NOT_FOUND</p>
<Nav />
<style>
.heading {
color: var(--second-text-color);
}
.err_code {
color: white;
}
</style>