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', () => {