HAPROXY中ACL的子域中的通配符

the*_*ing 5 regex routing haproxy

尝试在haproxy中匹配以下内容:

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

网址可以是foo-staging.something.comfoo.something.com

我查看了https://www.haproxy.com/doc/aloha/7.0/haproxy/acls.html#data-types-and-matching-between-samples-and-patterns上的文档,但是很难过找到我需要的模式匹配.

任何帮助赞赏!

Mic*_*bot 10

你想要hdr_reg()("reg"ex),而不是hdr_beg()(文字字符串前缀/"求"一局).

acl instagiveweb hdr_reg(host) -i ^foo[^\.]*\.example\.com$
Run Code Online (Sandbox Code Playgroud)

这应该匹配整个主机头,只有当foo后跟0或更多任何字符.开头时,除了后面.example.com的值结尾.