r/nginx: Configure logrotate
The default `logrotate` configuration for _nginx_ may not be appropriate for high-volume servers. The `nginx_keep_num_logs` variable is now available to control how many days of logs are kept.
This commit is contained in:
13
roles/nginx/templates/nginx.logrotate.j2
Normal file
13
roles/nginx/templates/nginx.logrotate.j2
Normal file
@@ -0,0 +1,13 @@
|
||||
/var/log/nginx/*.log {
|
||||
create 0640 nginx root
|
||||
daily
|
||||
rotate {{ nginx_keep_num_logs }}
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
delaycompress
|
||||
sharedscripts
|
||||
postrotate
|
||||
/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
|
||||
endscript
|
||||
}
|
||||
Reference in New Issue
Block a user