mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 01:13:05 +00:00
nginx: add logrotate rule for nginx logs
This commit is contained in:
parent
61c70dbc97
commit
c7618fbd9b
@ -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
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user