Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm hoping to get some direction on how to set up truncating and gzip'ing on my domains' access logs. I notice that the core nginx access logs get split and compressed by default, yet my individual access logs continue to grow.

Is this something that can be set up and is handled by nginx or something else on my system that is managing it's core logs?

share|improve this question
Use logrotate? – Michael Hampton Sep 13 '12 at 15:34

1 Answer 1

up vote 9 down vote accepted


/var/log/nginx/access_log {
    rotate 7
    size 5k
    dateformat -%Y-%m-%d
        test -r /var/run/ && kill -USR1 `cat /var/run/`
share|improve this answer
Awesome. Logrotate was new to me. Makes perfect sense now. Thanks! – Rob Sep 13 '12 at 15:41

Your Answer


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.