From 759643b8dbd5e9a686ce58b0b597e707896f056a Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sun, 30 Jul 2023 06:34:55 +0100 Subject: [PATCH] ldap: strip the html from the links --- applications/ldap.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/applications/ldap.nix b/applications/ldap.nix index be574e4..5671859 100644 --- a/applications/ldap.nix +++ b/applications/ldap.nix @@ -91,7 +91,16 @@ Gonna use a priper nixos module for this "${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}" = { forceSSL = true; useACMEHost = "skynet"; - root = "${inputs.skynet_ldap_frontend.defaultPackage."x86_64-linux"}"; + locations."/" = { + root = "${inputs.skynet_ldap_frontend.defaultPackage."x86_64-linux"}"; + # https://stackoverflow.com/a/38238001 + extraConfig = '' + if ($request_uri ~ ^/(.*)\.html) { + return 302 /$1; + } + try_files $uri $uri.html $uri/ =404; + ''; + }; }; };