diff --git a/README.md b/README.md index 5b13c17..10ab631 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,25 @@ $ sudo /usr/sbin/logrotate -f /etc/logrotate.conf #測試執行log壓縮程序 endscript } +/var/log/nginx/*.log { + daily + missingok + rotate 14 + compress + delaycompress + notifempty + create 0640 www-data adm + sharedscripts + prerotate + if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ + run-parts /etc/logrotate.d/httpd-prerotate; \ + fi \ + endscript + postrotate + invoke-rc.d nginx rotate >/dev/null 2>&1 + endscript +} + ``` ### 四、主機開機網站自動起始