carotte: zfs: disable
[sourcephile-nix.git] / hosts / mermet / nginx / autogeree.net / www.nix
index 6acd46aa3579ca5774ea03de6b1d4567e99860be..58ef3aaa87c6310b231c8c2dd3236b27545ad9cc 100644 (file)
@@ -11,13 +11,13 @@ in
       "nginx/${domain}/${srv}"
     ];
     LoadCredentialEncrypted = [
-      "${domain}.${srv}.julm.PC.htpasswd:${inputs.self}/hosts/${hostName}/nginx/${domain}/${srv}/julm/PC/htpasswd.cred"
-      "${domain}.${srv}.julm.perso.camera.htpasswd:${inputs.self}/hosts/${hostName}/nginx/${domain}/${srv}/julm/perso/camera.htpasswd.cred"
+      "${domain}.${srv}.julm.PC.htpasswd:${./. + "/${srv}/julm/PC/htpasswd.cred"}"
+      "${domain}.${srv}.julm.perso.camera.htpasswd:${./. + "/${srv}/julm/perso/camera.htpasswd.cred"}"
     ];
   };
   services.nginx = {
-    virtualHosts."${domain}.${srv}" = {
-      serverAliases = [ domain ];
+    virtualHosts.${domain} = {
+      serverAliases = [ "${srv}.${domain}" ];
       forceSSL = true;
       useACMEHost = domain;
       root = "${root}/${srv}";
@@ -55,6 +55,21 @@ in
           fancyindex_exact_size off;
         '';
       };
+      # Disable basicAuthFile for by-uuid
+      locations."~ ^/julm/perso/camera/([0-9]+/[0-9][0-9]/by-uuid/[0-9a-f-]+/.+)$" = {
+        alias = "${root}/julm/perso/camera/$1";
+        extraConfig = ''
+          autoindex off;
+        '';
+      };
+      locations."/julm/perso/images/" = {
+        alias = "${root}/julm/perso/images/";
+        extraConfig = ''
+          fancyindex on;
+          fancyindex_name_length 255;
+          fancyindex_exact_size off;
+        '';
+      };
     };
   };
 }