Fix resolvers block placement — must be outside global section
All checks were successful
HAProxy Manager Build and Push / Build-and-Push (push) Successful in 53s

The resolvers section was inserted inside the global section, causing
HAProxy to parse global directives (pidfile, maxconn, etc.) as
resolver keywords. Moved resolvers to its own top-level section
between global and defaults where HAProxy expects it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 05:18:48 -07:00
parent cf4eb5092c
commit 615044fa14

View File

@@ -18,21 +18,6 @@ global
log 127.0.0.1 local2 log 127.0.0.1 local2
chroot /var/lib/haproxy chroot /var/lib/haproxy
# DNS resolver for Docker container name resolution
# Re-resolves backend server addresses so container IP changes
# (from restarts, recreations, scaling) are picked up automatically
resolvers docker_dns
nameserver dns1 127.0.0.11:53
resolve_retries 3
timeout resolve 1s
timeout retry 1s
hold valid 10s
hold other 10s
hold refused 10s
hold nx 10s
hold timeout 10s
hold obsolete 10s
pidfile /var/run/haproxy.pid pidfile /var/run/haproxy.pid
maxconn 4000 maxconn 4000
user haproxy user haproxy
@@ -48,6 +33,24 @@ resolvers docker_dns
# Stats persistence for zero-downtime reloads # Stats persistence for zero-downtime reloads
stats-file /var/lib/haproxy/stats.dat stats-file /var/lib/haproxy/stats.dat
#---------------------------------------------------------------------
# DNS resolver for Docker container name resolution
# Re-resolves backend server addresses so container IP changes
# (from restarts, recreations, scaling) are picked up automatically
#---------------------------------------------------------------------
resolvers docker_dns
nameserver dns1 127.0.0.11:53
resolve_retries 3
timeout resolve 1s
timeout retry 1s
hold valid 10s
hold other 10s
hold refused 10s
hold nx 10s
hold timeout 10s
hold obsolete 10s
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will # common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block # use if not designated in their block