Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm a bit worried because its been a couple of days and my access log file is up to 250MB+. Does it roll log files over and delete them? I'd like for there only to be 1GB or less of log files total.

share|improve this question
add comment

1 Answer

Unlike apache, which provides the rotatelogs utility, ngingx relies on the OS for this task, specifically in the logrotate(8) utility.

In the nginx wiki, it is noted that file rotation can be safely handled using the USR1 signal. The same wiki page links to the Debian default lograte(8) script installed along the nginx package:

/var/log/nginx/*.log {
        daily
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        postrotate
                [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
        endscript
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.