HAProxy (Load Balance) - Check haproxy.cfg for synatx errors

by
Jeremy Canfield |
Updated: August 12 2024
| HAProxy (Load Balance) articles
The haproxy command with the -c (check mode) flag can be used to check the haproxy.cfg file for syntax errors. If no syntax errors are found, "Configuration file is valid" should be returned.
~]$ sudo haproxy -c -f /etc/haproxy/haproxy.cfg
Configuration file is valid
On the other hand, if one or more syntax errors are found, something like this should be returned.
]$ sudo haproxy -c -f /etc/haproxy/haproxy.cfg
[NOTICE] (68556) : haproxy version is 2.8.3-86e043a
[NOTICE] (68556) : path to executable is /usr/sbin/haproxy
[ALERT] (68556) : config : Proxy 'my_domains': unable to find table 'per_ip_and_url_rates' referenced by track-sc1.
[ALERT] (68556) : config : Fatal errors found in configuration.
Did you find this article helpful?
If so, consider buying me a coffee over at