From 681da3fd183291fd2f3c499830c8bfe130959a80 Mon Sep 17 00:00:00 2001 From: Moritz 'e1mo' Fromm Date: Thu, 13 Apr 2023 14:25:49 +0200 Subject: [PATCH] Support custom 404 page The actual 404 will be generated from pelican. log_not_found was set for privacy reasons (since we don't have a favicon, every request still gets logged with it's full IP due to the 404) --- services/website.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/website.nix b/services/website.nix index 16c8a69..a3c2ea4 100644 --- a/services/website.nix +++ b/services/website.nix @@ -41,6 +41,10 @@ in { serverAliases = [ "www.${baseDomain}" ]; root = webroot; locations = { + "/".extraConfig = '' + log_not_found off; + error_page 404 /404.html; + ''; "~* ^(/images/.+)\\.(png|jpe?g)$".extraConfig = '' set $base $1; add_header Vary Accept;