mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nginx: add logrotate rule for nginx logs
This commit is contained in:
parent
61c70dbc97
commit
c7618fbd9b
1 changed files with 12 additions and 0 deletions
|
@ -988,5 +988,17 @@ in
|
||||||
nginx.gid = config.ids.gids.nginx;
|
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…
Add table
Add a link
Reference in a new issue