请求体上限 2MB → 20MB(带图对话 413)
起因:会话 1790234457104-wwgr3uq 报 `413 请求体超过上限 2000000 字节`。dump 显示 agent_state 达 2,688,007 字节: 生成的 PNG 以 base64 内联进对话历史(单张 100KB~750KB),两条 assistant 消息 就占 2.5MB,把网关自有的 2MB 限制顶爆。 - server.max_body_size: 2_000_000 → 20_000_000(config.py 默认值 + gateway.yaml + _opt_int 兜底三处同步)。 - nginx 侧无需改动:全局 nginx.conf 已是 client_max_body_size 50m, 两个站点 conf 未单独设置 → 实际生效值 50m > 20m。 - 保留限制(只调大数字,不放开),内部网关 + nginx 两层仍在把关。 - 新增回归 test_server_max_body_size_is_20mb 钉住三处一致 (配置默认值 / YAML 现值 / 兜底解析)→ 202 passed / 0 failed。 上线实测(pid 3525434):3MB 与 19MB 请求体均过体积检查到鉴权层(401), 21MB 精确 413 且报「请求体超过上限 20000000 字节」。
This commit is contained in:
1 parent
64054ad920
commit
09df80d137
4 files changed
+48
-3
No files matched your search
+4
-1
@@ -407,7 +407,10 @@ server:
|
||||
hot_reload_interval: 15 # 重载检查间隔(秒)
|
||||
metrics_enabled: true # 记录调用指标(/metrics)
|
||||
rate_limit_rps: null # 全局单 user QPS 上限(null=不限;供应商级用 provider.rate_limit_rps)
|
||||
max_body_size: 2000000 # 请求体字节上限(防 DDoS,约 2MB)
|
||||
# 请求体字节上限。2026-09-24 从 2MB 提到 20MB:带图对话(生成/上传的 PNG 以
|
||||
# base64 内联进历史,单张 100KB~750KB)几张就顶爆 2MB → 上游 413
|
||||
# 「请求体超过上限 2000000 字节」。内部网关 + nginx 两层把关,保留限制只调大数字。
|
||||
max_body_size: 20000000
|
||||
cors_origins: ["*"] # CORS 允许来源(生产收紧为具体域名)
|
||||
graceful_shutdown: 30 # 优雅关闭等待在途请求的秒数
|
||||
# ── 防滥用 / 安全 ──
|
||||
|
||||
Reference in new issue
Block a user