From 5e617f0c1617dc6bf4384fd0703bb2ad2c208e20 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Fri, 28 Aug 2026 22:12:36 +0800 Subject: [PATCH] fix(admin): raise bounded API upload limit --- nginx/default.conf.template | 4 ++-- src/deployment/nginxConfig.test.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nginx/default.conf.template b/nginx/default.conf.template index 69457a86..3688b5f7 100644 --- a/nginx/default.conf.template +++ b/nginx/default.conf.template @@ -21,7 +21,7 @@ server { # 前端代码中的 API 前缀为 /api;保持原始路径转给 Gateway。 location /api/ { - client_max_body_size 12m; + client_max_body_size 55m; proxy_pass ${API_UPSTREAM}; proxy_http_version 1.1; proxy_set_header Host $proxy_host; @@ -32,7 +32,7 @@ server { # 海外业务使用独立 Gateway;将浏览器前缀改写为 Gateway 的 /api 前缀。 location /overseas-api/ { - client_max_body_size 12m; + client_max_body_size 55m; rewrite ^/overseas-api/(.*)$ /api/$1 break; proxy_pass ${OVERSEAS_API_UPSTREAM}; proxy_http_version 1.1; diff --git a/src/deployment/nginxConfig.test.ts b/src/deployment/nginxConfig.test.ts index a687f321..2fb21fba 100644 --- a/src/deployment/nginxConfig.test.ts +++ b/src/deployment/nginxConfig.test.ts @@ -9,8 +9,10 @@ const jenkinsfile = readFileSync(resolve(process.cwd(), 'Jenkinsfile'), 'utf8') const dockerfile = readFileSync(resolve(process.cwd(), 'Dockerfile'), 'utf8') describe('admin nginx deployment config', () => { - it('allows qualification uploads with multipart overhead through the API proxy', () => { - expect(config).toContain('client_max_body_size 12m;') + it('allows 50 MiB files plus multipart overhead through both bounded API proxies', () => { + expect(config.match(/client_max_body_size 55m;/g)).toHaveLength(2) + expect(config).not.toContain('client_max_body_size 12m;') + expect(config).not.toContain('client_max_body_size 0;') }) it('prevents the application shell from retaining stale chunk references', () => {