From 71a3e19c65d6d4183c318eb80fd0f23b79e4e291 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Fri, 16 Mar 2018 17:02:42 +0100 Subject: [PATCH] mastus: website: enable 404 cgi script --- mastus/website.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mastus/website.nix b/mastus/website.nix index 810f520..949ed25 100644 --- a/mastus/website.nix +++ b/mastus/website.nix @@ -40,9 +40,21 @@ ssl_stapling_verify on; root /srv/www.gebner.org; - error_page 404 403 /404.html; + error_page 404 403 /404.cgi; access_log logs/website_access.log; + + location ~ [^/]\.cgi(/|$) { + fastcgi_split_path_info ^(.+?\.cgi)(/.*)$; + if (!-f $document_root$fastcgi_script_name) { + return 404; + } + fastcgi_pass unix:${config.services.fcgiwrap.socketAddress}; + } } ''; + + services.fcgiwrap = { + enable = true; + }; }