HAProxy set acl with hosts from file

ACLs in haproxy can take -f argument to load values from a file. You can read the documentation here.

For example:

acl valid-ua hdr(user-agent) -f exact-ua.lst -i -f generic-ua.lst test

The "-f" flag is followed by the name of a file from which all lines will be read as individual values. It is even possible to pass multiple "-f" arguments if the patterns are to be loaded from multiple files. Empty lines as well as lines beginning with a sharp ('#') will be ignored.