nginx lets through the uploads the backend accepts: no limit was set, so its 1 MB default refused them all (#1057) #1058
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/1057-nginx-upload-limit"
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?
Closes #1057.
Summary
nginx.confset noclient_max_body_size, so nginx's default of 1 MB applied to everything proxied to the backend. Confirmed on dev (v4.5.0-rc2): a 2 MB POST to/api/campaigns/importgets nginx's 413 and never reaches the app, while a 0.5 MB one does. That refused every map image (the backend allows 75 MB), handout file and page picture (8 MB), and campaign import (100 MB) in a deployed build. Thev4.4.1tag'snginx.confhas none either, so production behaves the same.location /api/setsclient_max_body_size 110m, just above the largest upload the backend accepts. The backend keeps the per-kind limits and their worded messages.tests/test_nginx_upload_limit.py, readsnginx.confand fails if the proxy's limit is missing or falls below the backend's largest (media_max_upload_bytes,map_max_upload_bytes, and the import's cap). Nothing caught this before: the backend suite calls the app directly, and the journeys upload small files.#991 part 2 will give the import route its own location, with the backend's admin-settable limit as the only one.
Changelog
changelog.d/1057-nginx-upload-limit.fixed.mdTest plan
nginx -ton the edited config innginx:1.31-alpine: syntax ok, test successful.🤖 Generated with Claude Code