Directory for haproxy config files

Hi
Due to complexity of my haproxy.cfg file, I would like to use one of more directories, from which haproxy will read all *.cfg files.

In my /etc/haproxy/haproxy.cfg, I would like to add a variable with the path (or multiple paths) of the config directory (e.g. /etc/haproxy/haproxy.d) - like many other servers do (e.g. Apache, NGINX, named, etc.)

I wasn’t able to find such a setting.
How can this be done?

P.S. I managed to find a solution, which works, but is too static and clunky - create a directory by hand, and modify haproxy’s systemd unit file to include that directory. I’m looking for a more dynamic, elegant solution.

$ cat /etc/systemd/system/multi-user.target.wants/haproxy.service | egrep -v '^#|^ *$'
[Unit]
Description=HAProxy Load Balancer
Documentation=man:haproxy(1)
After=syslog.target network.target
[Service]
EnvironmentFile=-/etc/sysconfig/haproxy
Environment="CONFIG=/etc/haproxy/haproxy.cfg -f /etc/haproxy/haproxy.d" "PIDFILE=/run/haproxy.pid" "EXTRAOPTS=-S /run/haproxy-master.sock"
ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS
ExecStart=/usr/sbin/haproxy -Ws -f $CONFIG -p $PIDFILE $EXTRAOPTS
ExecReload=/usr/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=mixed
Restart=always
SuccessExitStatus=143
Type=notify
[Install]
WantedBy=multi-user.target

It should be noted, that with the above configuration, it is easy to misuse the haproxy configuration check:

haproxy -c -f /etc/haproxy/haproxy.cfg

…will only check the haproxy config in this particular file.
If there is an error in one of the config files under haproxy.d/*.cfg, the config check will report the haproxy config as correct, but haproxy may fail to restart.

Of course, the correct way to use haproxy config check in such a case would be:

haproxy -c -f /etc/haproxy/haproxy.cfg -f /etc/haproxy/haproxy.d/

As mentioned earlier, using the systemd unit file to include an additional directory for haproxy config files is clunky and prone to errors.

Is there a more elegant way to do it?

For example, in NGINX, it is possible to include further directories using the include statement in the main config file.

include /etc/nginx/conf.d/*.conf;

That’s the correct way of doing it, and I am looking for a similar solution in haproxy.