Add custom 404 page
This commit is contained in:
parent
b2e507c845
commit
4b48303c4e
12
nginx.conf
12
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/ {
|
||||
|
23
src/routes/err/404/+page.svelte
Normal file
23
src/routes/err/404/+page.svelte
Normal 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>
|
Loading…
Reference in New Issue
Block a user