Rotate your Nginx logs right from your config.
Andy Dyrcz
12
If your looking to do sized based rotation, your nginx config is not the best location to do this. You will want to use an external method like a manual find and rotate/compress script you write yourself and add to cron or the easiest way of just using logrotate…
The reason I initially looked into time-based was to eliminate the daisy chain of tasks that it takes to rotate your logs. This allows you to rule out any issues with Cron or any type of log rotating daemons you decide to use…