fix(nginx): suppress error logs for specific locations in nginx configuration

This commit is contained in:
jxxghp
2026-06-20 14:59:56 +08:00
parent 33b18f0899
commit c065eddff1

View File

@@ -11,6 +11,8 @@ location / {
# 本地CookieCloud
location /cookiecloud {
error_log /dev/null crit;
proxy_pass http://backend_api;
rewrite ^.+mock-server/?(?<suffix>.*)$ /$suffix break;
proxy_http_version 1.1;
@@ -30,6 +32,8 @@ location /cookiecloud {
# SSE特殊配置
location ~ ^/api/v1/(system/(message|progress/|logging)|search/.*/stream$) {
error_log /dev/null crit;
# SSE MIME类型设置
default_type text/event-stream;
@@ -53,6 +57,8 @@ location ~ ^/api/v1/(system/(message|progress/|logging)|search/.*/stream$) {
# API代理配置
location /api {
error_log /dev/null crit;
proxy_pass http://backend_api;
rewrite ^.+mock-server/?(?<api_path>.*)$ /$api_path break;
proxy_http_version 1.1;
@@ -105,6 +111,8 @@ location /assets {
# 站点图标
location /api/v1/site/icon/ {
error_log /dev/null crit;
# 站点图标缓存
proxy_cache my_cache;
# 缓存响应码为200和302的请求1小时