关于haproxy hdr_reg(host) 的一些解释

I've recently taken over an environment using HAProxy, and I'm attempting to learn the config and what it all means, but I'm 

finding some aspects of it are not clear. 

我最近在用Haproxy,我尝试学习配置,但是我发现有些方面不是很清楚
What does “acl cdn_name hdr_beg(host) -i foor.bar.com” mean in HAProxy's configuration?


     acl zjtest7_com   hdr_reg(host)  -i zjtest7.com
      use_backend zjtest7_com  if  zjtest7_com 
      


I think the above means that if host header begins with "foo.bar.com" then use the cdn cdn_name, but I'm not totally sure. Can 

somebody confirm for me 

我认为如果主机请求头是以"foo.bar.com" 开始 那么使用 cdn_name 


It's defining an ACL with the name cdn_name, with the criteria hdr_beg(host) -i foo.bar.com. The criteria basically means that the 

HTTP Host: header begins with "foo.bar.com" and it uses case-insensitive matching (the "-i" flag).

这是定义一个ACL 使用标准的 hdr_beg(host) -i foo.bar.com. 


标准基本意思是  HTTP Host:header 开始以"foo.bar.com"  那么它使用不区分大小写的匹配


但是这个实际上什么业不做,但是它会进一步用于你的配置,你可能会看到下面这样的东西

<something something> if cdn_name


如果客户请求使用一个  Host: header 是以"foo.bar.com" 开始,

HAproxy 会做任何 定义在<something something> 里

posted @   czcb  阅读(743)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 字符编码:从基础到乱码解决
点击右上角即可分享
微信分享提示