Compare commits
2 commits
d99b19d84e
...
ec0afc6085
Author | SHA1 | Date | |
---|---|---|---|
Tristan Daniël Maat | ec0afc6085 | ||
Tristan Daniël Maat | c7d46f1c2b |
|
@ -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 = {
|
||||||
|
|
Loading…
Reference in a new issue