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

26 lines
457 B
Nix
Raw Normal View History

{ config, ... }:
let
cfg = config.const.host.nginx;
root = "/storage/hot/share";
2025-01-09 20:12:27 +03:00
index = ''
autoindex on;
charset UTF-8;
'';
in
2025-01-09 13:09:49 +03:00
{
"share.${cfg.domain}" = {
inherit (cfg) sslCertificate sslCertificateKey extraConfig;
locations = {
2025-01-09 17:13:36 +03:00
# "~* /$" = {
"= /" = {
inherit root;
2025-01-09 20:12:27 +03:00
extraConfig = index + cfg.allowLocal;
};
"/" = {
inherit root;
2025-01-09 20:12:27 +03:00
extraConfig = index;
};
};
};
2025-01-09 13:09:49 +03:00
}