web: nginx allows 5 MiB on /api/ to match the API (#160 finding 10); SELF_HOSTING names the proxy body limit

This commit is contained in:
Boris Kurktchiev committed 2026-09-11 10:23:58 -04:00
1 parent 8b2fc43c8a
commit db48e6e00d
2 files changed
+7 -1

No files matched your search

+3 -1
View File
@@ -80,7 +80,9 @@ gym.example.com {
### Option C — Traefik / nginx / Nginx Proxy Manager
Route `gym.example.com` (HTTPS) → `web:80` (or `<docker-host>:8080`). Any reverse proxy works —
openGym only needs the browser to reach it over `https://gym.example.com`.
openGym only needs the browser to reach it over `https://gym.example.com`. If that proxy caps
request bodies (nginx does, at 1 MiB by default), allow at least 5 MiB on `/api/` — the app syncs
its whole history in one PUT; the bundled web image already allows 5 MiB, matching the API.
Then set your domain in `.env` and restart:
+4
View File
@@ -20,6 +20,10 @@ server {
# as /api/anything.json would be matched by the \.(js|css|json|html)$ block instead and be
# looked for on disk rather than proxied.
location ^~ /api/ {
# Match the API's own body limit (MAX_BODY in api/server.js): the whole workout history
# travels in one PUT /api/data, and nginx's 1 MiB default would answer 413 here before the
# API ever saw it — a sync that silently stops once the history grows past 1 MiB.
client_max_body_size 5m;
# Resolved per request through Docker's DNS, not once at start-up: nginx otherwise pins
# the api container's IP when it boots, and a recreated api (new IP) means 502 on every
# /api call until web is restarted too (issue #16). The variable is what makes nginx