CharlyBr on Jul 17th, 2008Rotate Nginx log files under FreeBSD
To rotate your nginx log files, you can use the log file handler provided by FreeBSD: newsyslog.
Configuring /etc/newsyslog.conf
/var/log/nginx-access.log 644 7 1024 * JC /var/run/nginx.pid
/var/log/nginx-error.log 644 7 1024 * JC /var/run/nginx.pid
Before log rotation:
-rw-r–r– 1 root wheel 104278002 Jul 16 11:35 nginx-access.log
-rw-r–r– 1 root wheel 1509531 Jul 16 11:17 nginx-error.log
After log rotation:
-rw-r–r– 1 root wheel 967 Jul [...]