Raise report upload request size limits

- Configure NestJS with an explicit JSON and urlencoded body parser limit controlled by API_BODY_LIMIT.

- Set the default API body limit to 100mb for report HTML, key frames, template images, and Data URL file uploads.

- Add a matching Nginx client_max_body_size 100m limit so Docker web proxy no longer rejects large report saves first.

- Document the new request body limit in README, deployment docs, progress notes, environment example, and AGENTS context.

- Rebuild and verify Docker web/api with a large report save through the Nginx /api proxy.
This commit is contained in:
2026-05-02 03:29:46 +08:00
parent 285dbd2023
commit 2a86d9f5e4
8 changed files with 16 additions and 3 deletions

View File

@@ -121,6 +121,7 @@ cp .env.example .env.local
当前环境变量:
- `API_PORT`NestJS API 监听端口,本地直接运行默认 `3100`Docker Compose 暴露到宿主机的默认端口是 `3002`
- `API_BODY_LIMIT`NestJS JSON/urlencoded 请求体上限,默认 `100mb`,用于报告 HTML、图片/关键帧和文件 Data URL 上传。
- `CORS_ORIGIN`:允许携带 Cookie 访问 API 的前端来源。
- `DATABASE_URL`PostgreSQL 连接串。Docker Compose 暴露到宿主机的默认端口是 `5433`,容器内部仍使用 `db:5432`
- `SESSION_SECRET`:后端 Session Cookie 签名密钥,生产环境必须替换。
@@ -237,7 +238,7 @@ docker-compose down
- `web` 服务使用 Nginx 托管前端 `dist/`
- `api` 服务运行 NestJS 后端,并把上传文件目录挂载到 `uploads_data` volume。
- `db` 服务运行 PostgreSQL 16。
- `nginx.conf` 已配置 SPA 路由回退`/api` 反向代理。
- `nginx.conf` 已配置 SPA 路由回退`/api` 反向代理`100m` 请求体上限
- `nginx.conf` 已支持 `/api/speech/iat` WebSocket upgrade。
## 当前限制