Compare commits

..

2 commits

Author SHA1 Message Date
Tristan Daniël Maat ec0afc6085
fail2ban: Add metrics 2023-10-03 02:26:57 +02:00
Tristan Daniël Maat c7d46f1c2b
WIP: nginx: Add metrics 2023-10-03 02:26:54 +02:00

View file

@ -150,26 +150,8 @@
''; '';
}; };
services.logrotate = {
enable = true;
settings = lib.mapAttrs' (virtualHost: _:
lib.nameValuePair "/var/log/nginx/${virtualHost}/access.log" {
frequency = "daily";
rotate = 2;
compress = true;
delaycompress = true;
su = "${config.services.nginx.user} ${config.services.nginx.group}";
postrotate = "[ ! -f /var/run/nginx/nginx.pid ] || kill -USR1 `cat /var/run/nginx/nginx.pid`";
})
config.services.nginx.virtualHosts;
};
systemd.tmpfiles.rules = systemd.tmpfiles.rules =
lib.mapAttrsToList ( lib.mapAttrsToList (virtualHost: config: "d /var/log/nginx/${virtualHost} 0750 nginx nginx")
virtualHost: _:
#
"d /var/log/nginx/${virtualHost} 0750 ${config.services.nginx.user} ${config.services.nginx.group}"
)
config.services.nginx.virtualHosts; config.services.nginx.virtualHosts;
security.acme = { security.acme = {