fix(docker): derive nginx resolver from container DNS

Hardcoded resolver 127.0.0.11 only exists on user-defined networks, so a plain
docker run on the default bridge 502'd (DNS connection refused). Render the
resolver from /etc/resolv.conf at start so per-request proxy_pass resolves on
both the default bridge (host DNS) and compose networks (embedded DNS).
This commit is contained in:
Offending Commit
2026-06-02 13:33:50 -05:00
parent 6b602c05bb
commit 66b299a28e
2 changed files with 11 additions and 2 deletions

View File

@@ -12,8 +12,9 @@ server {
# Don't leak the nginx version.
server_tokens off;
# Resolver required for per-request DNS when proxy_pass targets a runtime variable.
resolver 127.0.0.11 ipv6=off valid=10s;
# The resolver (required for per-request DNS with a runtime-variable proxy_pass)
# is rendered by the entrypoint into conf.d from the container's own DNS, so it
# works on both user-defined networks (127.0.0.11) and the default bridge.
# Header-driven same-origin proxy: the browser names the Honcho upstream per
# request via X-Honcho-Upstream, so the browser never makes a cross-origin call.