Answer the question
In order to leave comments, you need to log in
How to properly rotate nginx logs?
The task is as follows:
this is the basic version that comes with a web server for archiving logs.
/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
}
Answer the question
In order to leave comments, you need to log in
Just add the line
/var/log/nginx/*.log
/var/www/*/log/*.log
{
to the config
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question