HAProxy Combined Acls

I'm trying to make a combined acl in the haproxy config.
Is this kind of thing possible ??

  acl bare-dom1 hdr(host) -m reg -i domain1.org(:[0-9]+)?$
  acl bare-dom2 hdr(host) -m reg -i domain2.org(:[0-9]+)?$
  acl bare-dom3 hdr(host) -m reg -i domain3.org(:[0-9]+)?$
  acl needs-www (bare-dom1 || bare-dom2 || bare-dom3)

Unfortunately from looking around so far, I don't see a way to do it. Yeah sure I could add the big OR to the place where I'm going to use it, but maybe I will have 20 domains later, and if I'm gonna use it in multiple places its going to get ugly.


Solution 1:

You can repeat an ACL with the same name multiple times, they will be combined as with 'OR' operator.

Example:

acl bare-dom hdr(host) -m reg -i domain1.org(:[0-9]+)?$
acl bare-dom hdr(host) -m reg -i domain2.org(:[0-9]+)?$
acl bare-dom hdr(host) -m reg -i domain3.org(:[0-9]+)?$
use_backend backend bare-dom

I don't think it is possible to combine named ACLs into another named ACL.