Skip to content

fix(frontend): let export archives past nginx's body limit - #24

Merged
danielededo merged 1 commit into
mainfrom
fix/nginx-archive-body-limit
Oct 11, 2026
Merged

danielededo merged 1 commit into
mainfrom
fix/nginx-archive-body-limit

Conversation

@danielededo

Copy link
Copy Markdown
Owner

nginx capped request bodies at 24m, which fits a single activity file (MAX_UPLOAD_BYTES, 20 MiB), but the API accepts export archives up to MAX_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.

  • Raise client_max_body_size to 210m, above the API's request-level cap.
  • Add test_the_proxy_admits_the_largest_body_the_api_accepts, which reads frontend/nginx.conf and fails if its limit drops below the default max_request_bytes. Verified it fails on the old 24m.

Checks: ruff lint and format, pytest 344 passed, coverage 96.5%.

Not changed: proxy_read_timeout 120s may still cut off a very large archive while it is being processed. I haven't measured that, so it is left as is.

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.
@danielededo
danielededo merged commit 7419a22 into main Oct 11, 2026
5 checks passed
@danielededo
danielededo deleted the fix/nginx-archive-body-limit branch October 11, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant