Commit Graph
4 Commits
Author SHA1 Message Date
TheInfamousToTo 2df725de84 web: make the nginx resolver configurable so /api works off Docker
The /api location re-resolves BACKEND on every request, which needs a resolver
address, and that address was hardcoded to 127.0.0.11 — Docker's embedded DNS.
Nothing listens there on another runtime, and an unreachable resolver does not
fail fast: every /api request hangs until it times out, with nothing in the
error log to say why. On Kubernetes that means the app shell loads and the whole
API is dead.

RESOLVER now carries it, defaulting to 127.0.0.11 so Docker and every existing
compose file are unchanged. Kubernetes sets it to the kube-dns service address;
Podman to whatever its network provides. Documented next to the four other
render-time settings in SELF_HOSTING.md, since it belongs to the same "fitting
it into an existing stack" problem.
2026-09-07 21:42:51 +03:00
Duarte Santos c78bc6763f web: nginx loest den api-Container pro Request auf (502 nach api-Recreate, #16); renovate.json ohne _comment/_managers (#37)
nginx pinnte die IP von `api` beim Start; wird nur der api-Container neu erzeugt, laeuft jeder
/api-Aufruf auf 502, bis auch web neu startet. `resolver 127.0.0.11 valid=10s` plus proxy_pass
ueber eine Variable laesst nginx den Namen pro Request neu aufloesen.

Renovate lehnte die Konfiguration wegen der Pseudo-Schluessel `_comment` und `_managers` ab
("Invalid configuration option") und hatte die MRs eingestellt; beide Texte stehen jetzt im
offiziellen `description`-Feld.
2026-09-05 13:31:43 +02:00
JoseviandClaude Opus 5 ec3dc8ba69 web: cabeceras de proxy no falsificables, /api prioritario y cabeceras de seguridad
X-Forwarded-For se ponia con $proxy_add_x_forwarded_for, que APENDE lo que mande
el cliente, y el API lee la primera entrada — asi que cualquiera elegia la IP que
quedaba registrada contra el en el activity log. CF-Connecting-IP no la tocaba
nadie y es la que el API mira primero. Ahora se sobrescribe con $remote_addr y la
de Cloudflare se descarta salvo que pongas CF_CONNECTING_IP=$http_cf_connecting_ip,
que solo es correcto con Cloudflare de verdad delante. .env.example afirmaba que el
stack venia correcto de fabrica; no era cierto.

location /api/ pasa a ^~ para que gane a los location con regex: sin eso una ruta
como /api/algo.json la atraparia el bloque \.(js|css|json|html)$ y se buscaria en
disco en vez de proxearse. Hoy no rompe nada, manana si.

Y cuatro cabeceras de seguridad, repetidas en los dos location con regex porque
add_header dentro de un location reemplaza los heredados en vez de sumarse. Sin
HSTS ni CSP completa a proposito: eso sigue siendo del reverse proxy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 10:01:07 +02:00
Georgiy Sitnikov 1ba378b632 - Enable Templating feature as per https://hub.docker.com/_/nginx#using-environment-variables-in-nginx-configuration-new-in-119
- Set default Variables
Solution for https://github.com/DuarteSantos8/openGym/issues/99
2026-08-14 12:11:38 +02:00