Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

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

Boris Kurktchievdb48e6e00d1c
diff --git a/docs/SELF_HOSTING.md b/docs/SELF_HOSTING.md
index c639d8d82..3534d6f54 100644
--- a/docs/SELF_HOSTING.md
+++ b/docs/SELF_HOSTING.md
@@ -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:
diff --git a/web/nginx.conf.template b/web/nginx.conf.template
index f92ce83f9..e698efc91 100644
--- a/web/nginx.conf.template
+++ b/web/nginx.conf.template
@@ -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