nginx: add logrotate rule for nginx logs

This commit is contained in:
Dominique Martinet 2022-02-11 17:17:42 +09:00
parent 61c70dbc97
commit c7618fbd9b

View File

@ -988,5 +988,17 @@ in
nginx.gid = config.ids.gids.nginx;
};
services.logrotate.paths.nginx = mapAttrs (_: mkDefault) {
path = "/var/log/nginx/*.log";
frequency = "weekly";
keep = 26;
extraConfig = ''
compress
delaycompress
postrotate
[ ! -f /var/run/nginx/nginx.pid ] || kill -USR1 `cat /var/run/nginx/nginx.pid`
endscript
'';
};
};
}