0

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.

1

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
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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