diff --git a/frontend-v2/nginx.conf b/frontend-v2/nginx.conf index 2487a49c..adefb978 100644 --- a/frontend-v2/nginx.conf +++ b/frontend-v2/nginx.conf @@ -17,6 +17,9 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; + # ⚠️ 文件上传大小限制(默认只有 1MB,太小会导致 413 错误) + client_max_body_size 50M; # 允许上传最大 50MB 文件 + # 日志格式 log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' @@ -101,6 +104,9 @@ http { # 后端 API 代理(关键配置) location /api/ { + # 文件上传大小限制(PKB 文档上传等场景) + client_max_body_size 50M; + # 代理到后端服务 proxy_pass http://backend;