Context
A live outage showed the failure mode: a vhost whose proxy_pass upstream host does not resolve at nginx startup makes nginx abort with [emerg] host not found in upstream "...". nginx then refuses to start at all — so one bad config takes down every site the proxy serves, not just that one.
nginx resolves a static upstream hostname once, at config-load time; if it fails, the whole load fails.
Proposal
Resolve upstreams per request instead of at startup.
easyhome/nginx.conf — add resolver 127.0.0.11 valid=30s; (Docker's embedded DNS) in the http context.
easyhome/templates/*.conf — change proxy_pass http://<host>; to set $upstream <host>; + proxy_pass http://$upstream;.
With a variable in proxy_pass, nginx resolves at request time: an unresolvable backend yields a 502 for that vhost only — nginx still starts and serves every other site.
Acceptance criteria
🤖 Generated with Claude Code
Context
A live outage showed the failure mode: a vhost whose
proxy_passupstream host does not resolve at nginx startup makes nginx abort with[emerg] host not found in upstream "...". nginx then refuses to start at all — so one bad config takes down every site the proxy serves, not just that one.nginx resolves a static upstream hostname once, at config-load time; if it fails, the whole load fails.
Proposal
Resolve upstreams per request instead of at startup.
easyhome/nginx.conf— addresolver 127.0.0.11 valid=30s;(Docker's embedded DNS) in thehttpcontext.easyhome/templates/*.conf— changeproxy_pass http://<host>;toset $upstream <host>;+proxy_pass http://$upstream;.With a variable in
proxy_pass, nginx resolves at request time: an unresolvable backend yields a 502 for that vhost only — nginx still starts and serves every other site.Acceptance criteria
easyhome/nginx.confdefines aresolver.proxy_pass./domainsare not auto-migrated — they keep the old static form until regenerated.🤖 Generated with Claude Code