From 0d07b963b7d4fef6ce0df366b0933e184d164cbc Mon Sep 17 00:00:00 2001 From: jmal Date: Thu, 26 Jun 2025 10:24:10 +0800 Subject: [PATCH] =?UTF-8?q?conf/nginx:=20=E9=85=8D=E7=BD=AE=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 nginx.conf.no_office.template 和 nginx.conf.template 中添加日志配置 - 关闭访问日志记录 - 设置错误日志级别为 warn --- nginx.conf.no_office.template | 4 ++++ nginx.conf.template | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/nginx.conf.no_office.template b/nginx.conf.no_office.template index f99ec8f..fbbdecc 100644 --- a/nginx.conf.no_office.template +++ b/nginx.conf.no_office.template @@ -23,6 +23,10 @@ http { keepalive_timeout 65; #gzip on; + # 日志 + access_log off; + error_log /var/log/nginx/error.log warn; + map $http_upgrade $connection_upgrade { default upgrade; '' close; diff --git a/nginx.conf.template b/nginx.conf.template index 02a303b..d58e122 100644 --- a/nginx.conf.template +++ b/nginx.conf.template @@ -17,6 +17,10 @@ http { include mime.types; default_type application/octet-stream; + # 日志 + access_log off; + error_log /var/log/nginx/error.log warn; + # 全局性能优化 sendfile on; tcp_nopush on;