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> 裏