1
0
nixfiles/hosts/storage-2/storage.nix

39 lines
782 B
Nix

{ ... }:
{
services.nginx.virtualHosts = {
"storage.clerie.de" = {
enableACME = true;
forceSSL = true;
basicAuthFile = "/var/src/secrets/nginx/storage.htpasswd";
locations."= /" = {
alias = "${./filemanager}/";
extraConfig = ''
try_files index.html =404;
'';
};
locations."/_/" = {
alias = "/data/";
extraConfig = ''
autoindex on;
autoindex_format json;
client_body_temp_path /data;
dav_methods PUT DELETE MKCOL COPY MOVE;
create_full_put_path on;
dav_access group:rw all:r;
client_max_body_size 1G;
'';
};
};
};
systemd.services.nginx.serviceConfig = {
ReadWritePaths = "/data";
};
}