fix(suspended): tolerate startup DNS failure + use docker_dns resolvers
All checks were successful
HAProxy Manager Build and Push / Build-and-Push (push) Successful in 52s
All checks were successful
HAProxy Manager Build and Push / Build-and-Push (push) Successful in 52s
If the upstream container isn't up when haproxy-manager starts (e.g. when haproxy is recreated before whp-suspended), the default `init-addr libc` mode makes haproxy refuse to start — taking down the whole proxy. Switched to `init-addr last,none` (use last known address, fall back to 0.0.0.0 = DOWN) and added `resolvers docker_dns` (defined in hap_header.tpl) so the real IP is picked up once DNS becomes resolvable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,4 +10,9 @@ backend bk_suspended
|
|||||||
option http-server-close
|
option http-server-close
|
||||||
http-request set-header X-Forwarded-Proto https if { ssl_fc }
|
http-request set-header X-Forwarded-Proto https if { ssl_fc }
|
||||||
http-request set-header X-Forwarded-For %[src]
|
http-request set-header X-Forwarded-For %[src]
|
||||||
server suspended {{ target }} check inter 30s
|
# init-addr last,none: tolerate startup-time DNS resolution failure
|
||||||
|
# (the upstream container may not be up yet when haproxy-manager starts).
|
||||||
|
# resolvers docker_dns: re-resolve via Docker's embedded DNS at 127.0.0.11
|
||||||
|
# so the server picks up the real IP once the upstream becomes available
|
||||||
|
# (the docker_dns block is defined in hap_header.tpl).
|
||||||
|
server suspended {{ target }} check inter 30s init-addr last,none resolvers docker_dns
|
||||||
|
|||||||
Reference in New Issue
Block a user