I have almost 200 lines of ACL configurations in haprox.cfg
and also contains 150 backends.
To remove this configuration complexity, I want to bundle this configuration in separate files and will import those files in haprox.cfg
.
Is this possible in haproxy?
Import configuration files in haproxy.cfg
haproxy
Related Topic
- HAProxy – How to raise the log level of responses with status code above 400
- HAProxy – Multiple sites, multiple acl’s
- HAProxy – How to Process /.well-known Before Any Redirects
- HAProxy: How to Annotate an IP Whitelist File
- HAProxy: Using path variables to match one acl to a backend, depending on variable
Best Answer
As far as I know HAproxy does not have anything similar to apache's
Include & IncludeOptional
directives.There is no native support for multiple configuration files other than starting HAproxy with repeated
-f <config-file>
command line switches. see this thread.You can script something though to merge multiple subsections into a larger file similar to this approach although I would probably go the route and modify the init script to append additional configuration files automatically (untested):