Repository navigation
fix(frontend): let export archives past nginx's body limit - #24
Merged
Merged
Conversation
nginx capped request bodies at 24m, sized for a single activity file, while the API accepts archives up to MAX_ARCHIVE_BYTES (200 MiB) plus 1 MiB of framing. Any Garmin or Strava export over 24 MiB got nginx's HTML 413 and never reached FastAPI. Raise the cap to 210m and add a test that fails if the proxy limit drops below the API's again.
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.
nginx capped request bodies at
24m, which fits a single activity file (MAX_UPLOAD_BYTES, 20 MiB), but the API accepts export archives up toMAX_ARCHIVE_BYTES(200 MiB) plus 1 MiB of multipart framing. Any Garmin or Strava export over 24 MiB was refused by nginx with an HTML 413 before it reached FastAPI.client_max_body_sizeto210m, above the API's request-level cap.test_the_proxy_admits_the_largest_body_the_api_accepts, which readsfrontend/nginx.confand fails if its limit drops below the defaultmax_request_bytes. Verified it fails on the old24m.Checks: ruff lint and format, pytest 344 passed, coverage 96.5%.
Not changed:
proxy_read_timeout 120smay still cut off a very large archive while it is being processed. I haven't measured that, so it is left as is.