make the notfound page customizable

fixes #755
This commit is contained in:
Girish Ramakrishnan
2021-01-08 11:02:06 -08:00
parent 0ef0c77305
commit 4a6f36bc0e

View File

@@ -28,6 +28,12 @@ server {
alias /home/yellowtent/platformdata/acme/;
}
location /notfound.html {
root <%= sourceDir %>/dashboard/dist;
try_files /notfound.html =404;
internal;
}
# for default server, serve the notfound page. for other endpoints, redirect to HTTPS
location / {
<% if ( endpoint === 'admin' || endpoint === 'setup' ) { %>
@@ -37,8 +43,8 @@ server {
<% } else if ( endpoint === 'redirect' ) { %>
return 301 https://<%= redirectTo %>$request_uri;
<% } else if ( endpoint === 'ip' ) { %>
root <%= sourceDir %>/dashboard/dist;
try_files /notfound.html =404;
root /home/yellowtent/boxdata;
try_files /custom_pages/notfound.html /notfound.html;
<% } %>
}
}
@@ -277,9 +283,15 @@ server {
# to clear a permanent redirect on the browser
return 302 https://<%= redirectTo %>$request_uri;
<% } else if ( endpoint === 'ip' ) { %>
location / {
root <%= sourceDir %>/dashboard/dist;
location /notfound.html {
root <%= sourceDir %>/dashboard/dist;
try_files /notfound.html =404;
internal;
}
location / {
root /home/yellowtent/boxdata;
try_files /custom_pages/notfound.html /notfound.html;
}
<% } %>
}