fuuko: Add media file index

This commit is contained in:
Simon Bruder 2021-03-05 16:12:25 +01:00
parent 878bdd30d5
commit 07f152cb20
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
3 changed files with 16 additions and 1 deletions

View file

@ -6,6 +6,7 @@
../../users/simon ../../users/simon
./services/grafana.nix ./services/grafana.nix
./services/media.nix
./services/prometheus.nix ./services/prometheus.nix
./services/scan.nix ./services/scan.nix
]; ];

View file

@ -0,0 +1,14 @@
{
services.nginx.virtualHosts."media.sbruder.de" = {
enableACME = true;
forceSSL = true;
basicAuthFile = "/data/media/.htpasswd";
root = "/data/media/";
locations."=/.htpasswd".return = "403";
};
services.nginx-interactive-index.virtualHosts."media.sbruder.de".locations."/".enable = true;
}

View file

@ -26,7 +26,7 @@ in
]; ];
locations = { locations = {
"/".extraConfig = '' "/".extraConfig = ''
rewrite ^/__assets/(.*)$ /media/__assets/$1; rewrite ^/__nginx-interactive-index-assets__/(.*)$ /media/__nginx-interactive-index-assets__/$1;
''; '';
} // lib.mapAttrs' } // lib.mapAttrs'
(name: secret: { (name: secret: {