diff --git a/deploy/logrotate-qihu.conf b/deploy/logrotate-qihu.conf new file mode 100644 index 0000000..6e55a76 --- /dev/null +++ b/deploy/logrotate-qihu.conf @@ -0,0 +1,36 @@ +# 七虎平台 logrotate 配置 +# 2026-08-10 — P2-3 (体检报告 #2.3 nginx access.log 6.3GB) +# 容器内只管 nginx log;auth.log 由宿主 rsyslog 管理 + +# nginx access.log: 每日滚动 + 保留 14 天 + 压缩 +/var/log/nginx/access.log { + daily + rotate 14 + compress + delaycompress + missingok + notifempty + create 0640 www-data adm + sharedscripts + postrotate + [ -f /var/run/nginx.pid ] && kill -USR1 $(cat /var/run/nginx.pid) || true + endscript +} + +# nginx error.log: 每日滚动 + 保留 7 天 +/var/log/nginx/error.log { + daily + rotate 7 + compress + delaycompress + missingok + notifempty + create 0640 www-data adm + sharedscripts + postrotate + [ -f /var/run/nginx.pid ] && kill -USR1 $(cat /var/run/nginx.pid) || true + endscript +} + +# auth.log 由宿主 rsyslog 自管(容器无 rsyslogd,无 syslog user) +# 如需在容器内管,需先 apt-get install -y rsyslog \ No newline at end of file