Skip to content

Instantly share code, notes, and snippets.

@karthiks
Created December 20, 2020 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karthiks/ab99b1f331e21b83ec7a23d48e908b40 to your computer and use it in GitHub Desktop.
Save karthiks/ab99b1f331e21b83ec7a23d48e908b40 to your computer and use it in GitHub Desktop.
default logrotation for nginx located at /etc/logrotate.d/nginx (per app logrotate is configured this way)
/var/log/nginx/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi \
endscript
postrotate
invoke-rc.d nginx rotate >/dev/null 2>&1
endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment