nix/host/x86_64-linux/home/nginx/Share.nix

27 lines
472 B
Nix
Raw Normal View History

{ config, ... }:
let
cfg = config.const.host.nginx;
root = "/storage/hot/share";
in
2025-01-09 13:09:49 +03:00
{
"share.${cfg.domain}" = {
inherit (cfg) sslCertificate sslCertificateKey extraConfig;
locations = {
"~* /$" = {
inherit root;
2025-01-09 17:08:21 +03:00
extraConfig =
cfg.allowLocal
+ ''
autoindex on;
'';
};
"/" = {
inherit root;
extraConfig = ''
autoindex off;
'';
};
};
};
2025-01-09 13:09:49 +03:00
}