mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
Per-app nginx gateways used proxy_pass with a literal docker container hostname. nginx OSS resolves that hostname once at startup; if the upstream container later restarts and gets a new IP (e.g. a partial compose-up after credential change), the gateway proxies onto a dead address until nginx itself reloads — the 502 we hit on taiga after a reuse-kept replaced the taiga-back container. Switch every per-app docker-hostname proxy_pass to a variable form so the embedded docker DNS re-resolves at request time: set $upstream_<rolename>_<purpose> http://<host>:<port>; proxy_pass $upstream_<rolename>_<purpose>; The full `resolver` directive (TTL + ipv6 toggle inherited from NETWORK_IPV6_ENABLED) lives in one SPOT — NETWORK_DOCKER_DNS_NGINX_DIRECTIVE in group_vars/all/08_networks.yml — so cache TTL and ipv6 stay consistent across the stack. In taiga the upstream `set` declarations hoist to server scope because taiga-back is reused across /api/, /oidc/ and /admin/; in nextcloud and kix each upstream is used exactly once so the declaration stays local. Locations whose original proxy_pass stripped the location prefix (`proxy_pass http://.../;` on /media/, /whiteboard/, /standalone-signaling/) keep that semantics via an explicit `rewrite ^<loc>(.*)$ /\$1 break;`, because variable-proxy_pass drops the implicit prefix-strip. kix's static files/kix-proxy.default.conf moves to templates/kix-proxy.default.conf.j2 so it can reference the new constant; the deploy task switches from copy to template accordingly. Drive-by: scripts/tests/e2e/rerun-spec.sh docstring refresh — the "only overwrites tests/playwright.spec.js" claim went stale when the rerunner started restaging every role-local playwright/*.js. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>