From 3a4105218b116055280199d9cd48af63a2b156f7 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Wed, 2 Oct 2019 10:52:04 +0200 Subject: [PATCH] add nginx config for custom 404 page --- build/proxy/nginx.conf | 7 +++++++ homepage/content/pages/404.md | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/build/proxy/nginx.conf b/build/proxy/nginx.conf index e258490..568853e 100644 --- a/build/proxy/nginx.conf +++ b/build/proxy/nginx.conf @@ -45,6 +45,13 @@ http { location /auditorium/ { try_files $uri $uri/ /auditorium/index.html; } + + error_page 404 /404.html; + location = /404.html { + internal; + root /www/data; + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive" always; + } } } diff --git a/homepage/content/pages/404.md b/homepage/content/pages/404.md index 5abceb5..5b0ceb5 100644 --- a/homepage/content/pages/404.md +++ b/homepage/content/pages/404.md @@ -1,7 +1,7 @@ Title: Page not found | offen description: offen is a free and open source analytics software for websites and web applications that allows respectful handling of data. -save_as: 404/index.html -href: /404/ +save_as: 404.html +href: /404.html ![Page not Found](/theme/images/content-404.webp){:class="image-text-560-315"}