3
我正在使用HAProxy 1.4.22。我有以下haproxy.conf文件:HAProxy有時選擇錯誤acl
global
maxconn 100000
daemon
defaults
mode http
retries 1
contimeout 8000
clitimeout 120000
srvtimeout 120000
stats enable
stats uri /haproxy-stats
stats auth admin:****************
option httpchk
frontend http-in
bind 16.9.13.39:80
maxconn 100000
acl is_l1 hdr_end(host) -i l1.mydomain.com
acl is_l2 hdr_end(host) -i l2.mydomain.com
acl is_l3 hdr_end(host) -i l3.mydomain.com
acl is_l0 hdr_end(host) -i mydomain.com
use_backend lora1 if is_l1
use_backend lora2 if is_l2
use_backend lora3 if is_l3
use_backend lora0 if is_l0
default_backend lora0
backend lora0
balance roundrobin
option forwardfor except 127.0.0.1 # stunnel already adds the header
server s0 127.0.0.1:5000 check inter 60000
backend lora1
balance source
option forwardfor except 127.0.0.1 # stunnel already adds the header
server s1 127.0.0.1:5001 check inter 60000
backend lora2
balance source
option forwardfor except 127.0.0.1 # stunnel already adds the header
server s2 127.0.0.1:5002 check inter 60000
backend lora3
balance source
option forwardfor except 127.0.0.1 # stunnel already adds the header
server s3 127.0.0.1:5003 check inter 60000
它一切正常。除了大約0.2%的客戶。有時當請求來自l1,l2或l3時。例如:
http://l3.mydomain.com/something
由於某些原因,HAProxy與域名不匹配,而是使用默認後端。我在我的應用程序中設置了日誌記錄,它報告接收端的主機名實際上是「l3.mydomain.com」。下面是我的應用程序接收頭:
host: 'l3.mydomain.com',
'user-agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4',
accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
referer: 'http://mydomain.com/menu/2034414/e2e1abb5500ed51391d6351b1cf03695',
'accept-encoding': 'gzip,deflate,sdch',
'accept-language': 'en-US,en;q=0.8',
'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
'x-proxy-id': '1407537728',
'x-forwarded-for': '10.201.4.168',
via: '1.1 10.201.255.254 (Mikrotik HttpProxy)'
問題:
我使用hdr_end()正常,並有配套可能會失敗時,一些特殊的情況下?
是否有某種方式記錄HAProxy收到的實際HTTP閱讀器,但只有在沒有任何內容匹配且使用default_backend規則時?