From ee5c0493d0f2d5945420fb31ceb1dfd82ad5d9a8 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Fri, 28 Aug 2026 22:12:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8D=87=E5=AE=A2=E6=88=B7=E7=AB=AFAP?= =?UTF-8?q?I=E4=B8=8A=E4=BC=A0=E8=AF=B7=E6=B1=82=E4=BD=93=E4=B8=8A?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx/default.conf.template | 4 ++-- src/deployment/nginxConfig.test.mjs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nginx/default.conf.template b/nginx/default.conf.template index 605ebfd..2c714ab 100644 --- a/nginx/default.conf.template +++ b/nginx/default.conf.template @@ -13,7 +13,7 @@ server { # 前端统一请求 /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; @@ -24,7 +24,7 @@ server { # 海外业务使用独立 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.mjs b/src/deployment/nginxConfig.test.mjs index c8f4703..c32b26a 100644 --- a/src/deployment/nginxConfig.test.mjs +++ b/src/deployment/nginxConfig.test.mjs @@ -7,8 +7,10 @@ const testCompose = readFileSync(new URL('../../docker-compose.test.yml', import const jenkinsfile = readFileSync(new URL('../../Jenkinsfile', import.meta.url), 'utf8') const dockerfile = readFileSync(new URL('../../Dockerfile', import.meta.url), 'utf8') -test('allows qualification uploads with multipart overhead through the API proxy', () => { - assert.match(config, /location \/api\/ \{[\s\S]*?client_max_body_size 12m;/) +test('allows 50 MiB uploads with multipart overhead through both API proxies', () => { + assert.match(config, /location \/api\/ \{[\s\S]*?client_max_body_size 55m;/) + assert.match(config, /location \/overseas-api\/ \{[\s\S]*?client_max_body_size 55m;/) + assert.equal(config.match(/client_max_body_size 55m;/g)?.length, 2) }) test('routes domestic and overseas browser APIs to their test gateways without duplicate api prefixes', () => {