Linux

Where Is the HAProxy Config File?

HAProxy's haproxy.cfg path, section layout, and the validation flag before reloads.

Last updated

HAProxy reads its whole world from haproxy.cfg, conventionally at /etc/haproxy. Global, defaults, frontend and backend sections stack in one file, with -f flags layering extras.

Always validate with haproxy -c before reloading. A typo in backends fails closed at parse time, which beats discovering it during a production reload.

Where HAProxy stores this, by platform

Linux
/etc/haproxy/haproxy.cfg

Validate with haproxy -c -f path. Extra files join with repeated -f flags. Logs go to syslog rather than a file, so check the journal for startup errors.

Frequently asked questions

How do I test an HAProxy config safely?

Run haproxy -c -f /etc/haproxy/haproxy.cfg. It parses everything including includes and reports the first error with file and line.

Where are HAProxy logs?

Nowhere by default. It emits via syslog, so configure rsyslog or journald capture. Missing logs usually mean the syslog side was never set up.

Notice an outdated path? Let us know.