HAProxy 101 - Basic Configuration Throwing Errors

Problems getting started - the most rudimentary config file throwing errors

Config File: (yes that’s all of it)

maxconn 10000

stats socket /var/run/haproxy.stat mode 600 level admin

log local0

chroot /var/empty


frontend stats
bind *:10001

mode http

stats enable

stats hide-version

stats refresh 10s

stats show-node

stats uri /stats

Error at startup
[NOTICE] (1055104) : haproxy version is 2.7.3
[NOTICE] (1055104) : path to executable is /usr/local/sbin/haproxy
[ALERT] (1055104) : config : Parsing [/etc/haproxy/haproxy.cfg:9]: frontend ‘stats’ has the same name as frontend ‘stats’ declared at /etc/haproxy/haproxy.cfg:9.
[ALERT] (1055104) : config : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT] (1055104) : config : Fatal errors found in configuration.


listen stats *:10001

instead of

frontend stats bind *:10001

you don’t have any frontend/backup definition to serve real traffic