fix: raise nginx's upload body size limit past its 1MB default - #71
Merged
Conversation
Root cause of "could not connect to server" on mobile photo uploads: nginx's own compiled-in client_max_body_size default (1MB) is smaller than the app's own upload caps (up to 50MB for video), and nothing in default.conf ever overrode it. nginx rejects the request with a 413 before it reaches the backend at all -- and because the client is often still mid-upload when that happens, the browser can see it as a raw connection failure rather than a clean HTTP error, which is what made this look like a network problem instead of a size limit. Confirmed via a local repro: the exact same 2MB file that the backend accepts directly gets a 413 through nginx's default config, and succeeds once this override is in place. Never caught during development because the Vite dev proxy used all session has no such limit -- only the production nginx config does. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
JustSamuel
enabled auto-merge (rebase)
August 18, 2026 12:25
Coverage Report for frontend
File CoverageNo changed files found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause of the "could not connect to server" reports on mobile photo uploads: nginx's compiled-in
client_max_body_sizedefault is 1MB, andfrontend/nginx/default.confnever overrode it, even though the app's own upload caps go up to 50MB (video). nginx rejects the request with a 413 before the backend ever sees it -- and because the client is often still mid-upload when nginx closes the connection, browsers can surface that as a raw network failure rather than a clean HTTP error, which is what made this look like a connectivity problem instead of a size limit.A real phone photo is almost always well over 1MB, so this failed reliably in production while never showing up in this session's own testing -- the Vite dev proxy used all session has no such limit at all, only the production nginx config does.
Root cause evidence
Reproduced locally with the real nginx image and the exact
/api/proxy config, pointed at the actual backend:401(bad token, but the full body reached the handler)413 Request Entity Too Large, 0 bytes uploadedclient_max_body_size 60m;added:401, full body uploaded -- matches the direct-to-backend result413-- the raised limit is bounded, not disabledTest plan