nginx has no client_max_body_size - uploads/imports >1 MB get 413 through the proxy #83
Labels
No labels
bug
duplicate
enhancement
future
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/TeaLeaves#83
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: High · Confidence: High (config fact - verify against the live Caddy edge) · Effort: XS · Category: ops
Evidence
app/nginx.conf- entire file has noclient_max_body_sizedirective (nginx default is 1 MB).api/src/lib/upload.ts:68,78(multer 2 GB),api/src/routes/import.ts:14(500 MB),api/src/routes/media.ts:38-55(500 MB video / 50 MB audio)./api/*→ api:3000.Problem
The bundled nginx is the in-stack proxy for
/api/*and sets no body-size limit, so nginx's 1 MB default applies. Any POST body over 1 MB - essentially every video, most images, every Twitter/Bluesky archive ZIP - is rejected with 413 before reaching multer.Impact
Core media-upload and archive-import features are non-functional through the production proxy for anything but tiny files. Verify: if uploads work on the live instance, the Caddy edge is overriding this - in which case the bundled config is still wrong for clean-machine reproducibility.
Fix
Add
client_max_body_size 2g;(or per-location limits matching the route caps) to the/api/block inapp/nginx.conf.Acceptance criteria
Filed from the 2026-07-15 codebase audit. Full report:
docs/.internal/report-2026-07-15.md(gitignored).Fixed in
9a87882(v7.1.0 wave 1).Added
client_max_body_size 2g;to the/api/proxy block inapp/nginx.conf— matches the largest route cap (multer 2 GB); the per-route limits still enforce tighter caps per endpoint. Verified on the dev server: the directive is present in the running app container (grep client_max_body_size /etc/nginx/...→client_max_body_size 2g;) and health isok. CI #3640 green.Note for the live edge: if uploads already worked in production, the Caddy edge was overriding nginx — this fixes the bundled config for clean-machine reproducibility regardless.