【问题标题】:Wildcard in subdomain for ACL in HAPROXYHAPROXY 中 ACL 的子域中的通配符
【发布时间】:2016-09-08 18:12:32
【问题描述】:

尝试在 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 的文档,但很难找到我需要的模式匹配。

任何帮助表示赞赏!

【问题讨论】:

  • 如果接受正则表达式,请尝试acl instagiveweb hdr_beg(host) -i foo[^.]*.something.comacl instagiveweb hdr_beg(host) -i foo(-staging)?.something.com

标签: regex routing haproxy


【解决方案1】:

你想要hdr_reg()(“reg”ex),而不是hdr_beg()(文字字符串前缀/“beg”inning)。

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

仅当以 foo 开头后跟 0 个或多个除 . 后跟 .example.com 的值末尾之外的任何字符时,这应该匹配整个主机头。

【讨论】:

    猜你喜欢
    • 2017-09-24
    • 1970-01-01
    • 1970-01-01
    • 2020-08-23
    • 2012-01-23
    • 1970-01-01
    • 1970-01-01
    • 2012-08-20
    • 2010-09-09
    相关资源
    最近更新 更多