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

Updated:   |  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 Buy Me A Coffee



Comments


Add a Comment


Please enter b8606d in the box below so that we can be sure you are a human.