Skip to content
Snippets Groups Projects
Commit f880ab9e authored by Deimos's avatar Deimos
Browse files

Salt: add logrotate config for nginx logs

parent d04da960
No related branches found
No related tags found
Loading
......@@ -23,3 +23,11 @@ nginx:
- user: root
- group: root
- mode: 644
# Add logrotate config to rotate daily and delete after 30 days
/etc/logrotate.d/nginx:
file.managed:
- source: salt://nginx/logrotate
- user: root
- group: root
- mode: 644
/var/log/nginx/*.log {
daily
missingok
rotate 30
compress
delaycompress
notifempty
create 640 nginx adm
sharedscripts
postrotate
if [ -f /var/run/nginx.pid ]; then
kill -USR1 `cat /var/run/nginx.pid`
fi
endscript
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment