HAPROXY中ACL子域中的通配符 [英] Wildcard in subdomain for ACL in HAPROXY

查看:96
本文介绍了HAPROXY中ACL子域中的通配符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



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



其中的网址可能是 foo-staging.something.com foo.something.com



我浏览了 https://www.haproxy.com/doc/aloha/7.0/ haproxy / acls.html#data-types-and-matching-samples和模式之间,但是很难找到我需要的模式匹配。



任何帮助表示赞赏!

解决方案

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

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

仅当以 foo 开头时,才应匹配整个主机头后跟0个或多个任意字符,但除外。,后跟 .example.com 。 / p>

Trying to match the following in haproxy:

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

where the url could be foo-staging.something.com or foo.something.com

I've 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 having a hard time finding the pattern matching that I need.

Any help appreciated!

解决方案

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

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

This should match the entire host header only if begins with foo followed by 0 or more of any character except . followed by .example.com at the end of the value.

这篇关于HAPROXY中ACL子域中的通配符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆