Compare commits

..

2 Commits

Author SHA1 Message Date
Ray Elliott fa61a2342c add custom nginx configuration
add custom nginx config so we can set custom 404 page
2020-05-03 15:42:33 +01:00
Ray Elliott 0d419af894 add 404 page 2020-05-03 15:28:27 +01:00
4 changed files with 45 additions and 0 deletions

34
app-nginx.conf.sigil Normal file
View File

@ -0,0 +1,34 @@
worker_processes 1;
error_log stderr;
pid nginx.pid;
daemon off;
events {
worker_connections 768;
}
http {
types_hash_max_size 2048;
include mime.types;
server {
listen {{ $.PORT }};
server_name _;
{{ if ne $.NGINX_ROOT "" }}
root /app/www/{{ $.NGINX_ROOT }};
{{ else }}
root /app/www;
{{ end }}
index index.html;
port_in_redirect off;
location / {
try_files $uri $uri/ /index.html;
}
error_page 404 /404.html;
location = /404.html {
root /app/www/{{ $.NGINX_ROOT }};
internal;
}
}
}

3
layouts/404.html Normal file
View File

@ -0,0 +1,3 @@
{{ define "content" }}
{{ partial "404.html" . }}
{{ end }}

View File

@ -0,0 +1,7 @@
<section class="container centered">
<div class="error">
<img src="/images/undraw-404.svg" alt="404 Page not found image">
<h1>{{ i18n "page_not_found" }}</h1>
<p>{{ i18n "page_does_not_exist" }}<br />{{ i18n "head_back" .Site.BaseURL | safeHTML }}</p>
</div>
</section>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 21 KiB