HAProxyconfiguration文件

它在哪里? 有时我会在/etc/haproxy.conf下看到它,其他时候在/etc/haproxy/haproxy.cfg 。 如果两者都居住在哪一个呢?

如果你看haproxy手册,你可以阅读:

 haproxy -f <configuration file> other options... 

所以,configuration文件是不可选的。 haproxy启动时必须指定。 所以,你需要检查你的启动文件,如/etc/init.d/haproxy

我现在的configuration位于/etc/haproxy/haproxy.cfg。

只需使用适当的权限运行configuration。

sudo haproxy -f /etc/haproxy/haproxy.cfg