diff --git a/nginx/http.template b/nginx/http.template index a2172f0..a463778 100644 --- a/nginx/http.template +++ b/nginx/http.template @@ -22,5 +22,12 @@ server { error_page 404 /_errors/404_site.html; - return 404; + location = /_errors/404_site.html { + root /var/www/html; + internal; + } + + location / { + try_files none =404; + } } diff --git a/nginx/https.template b/nginx/https.template index 7af50e0..4fc1f3a 100644 --- a/nginx/https.template +++ b/nginx/https.template @@ -58,5 +58,12 @@ server { error_page 404 /_errors/404_site.html; - return 404; + location = /_errors/404_site.html { + root /var/www/html; + internal; + } + + location / { + try_files none =404; + } } diff --git a/nginx/startup.template b/nginx/startup.template index f55091a..946d9b8 100644 --- a/nginx/startup.template +++ b/nginx/startup.template @@ -20,9 +20,14 @@ server { listen ${SNIKKET_TWEAK_HTTP_PORT}; listen [::]:${SNIKKET_TWEAK_HTTP_PORT}; - root /var/www/html; - error_page 404 /_errors/404_site.html; - return 404; + location = /_errors/404_site.html { + root /var/www/html; + internal; + } + + location / { + try_files none =404; + } }