From a71311222d55548ab8bf758163a9ae084a50fddf Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Fri, 26 Apr 2024 04:27:04 -0400 Subject: [PATCH] Infini-OPTIPLEX: refactor testing site --- hosts/Infini-OPTIPLEX/web.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/hosts/Infini-OPTIPLEX/web.nix b/hosts/Infini-OPTIPLEX/web.nix index abd66f0..2b168d9 100644 --- a/hosts/Infini-OPTIPLEX/web.nix +++ b/hosts/Infini-OPTIPLEX/web.nix @@ -19,19 +19,22 @@ in }; }; "test.inx.moe" = ssl // { - root = "/srv/web/inx.moe"; locations."/" = { - tryFiles = "$uri $uri.html =404"; + root = "/srv/web/inx.moe"; + tryFiles = "$uri $uri.html $uri/ =404"; extraConfig = '' deny all; - location ~ "\.(html|css|txt)" { - allow all; - } + error_page 403 404 /404.html; - location = /template.html { - deny all; - }; + location = /template.html { deny all; } + location /.git { deny all; } + + location = /404.html { allow all; internal; } + + location ~* "\.(html|css|txt)$" { allow all; } + location ~ "/[^.]+" { allow all; } + location ~ "/$" { allow all; } ''; }; };