Subdomain wildcard for ACL in HAPROXY

Trying to match the following in haproxy:

acl instagiveweb hdr_beg(host) -i foo*.something.com

where url can be foo-staging.something.comorfoo.something.com

I looked through the docs at https://www.haproxy.com/doc/aloha/7.0/haproxy/acls.html#data-types-and-matching-between-samples-and-patterns , but it's hard for me to find a suitable template.

Any help appreciated!

+4
source share
1 answer

You want hdr_reg()("reg" ex), not hdr_beg()(literal string prefix / "beg").

acl instagiveweb hdr_reg(host) -i ^foo[^\.]*\.example\.com$

, foo, 0 , ., .example.com .

+7

All Articles