From aaac107978140134dc54447440bfab807bf2ae2a Mon Sep 17 00:00:00 2001 From: jack Date: Tue, 15 Sep 2026 03:14:25 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加nginxlog處理 --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 +} + ``` ### 四、主機開機網站自動起始