我有以下配置:
frontend example.com-https
bind 1.1.1.1:443 ssl no-sslv3 alpn h2,http/1.1 crt /example.com.pem
capture request header Host len 40
acl own_backend hdr(host) -i sub1.example.com
...
acl own_backend hdr(host) -i subX.example.com
use_backend %[req.hdr(Host),lower] if own_backend
default_backend example.com
backend example.com
server worker1 2.2.2.2:80
backend sub1.example.com
server worker1 3.3.3.3:80
...
backend subX.example.com
server worker1 x.x.x.x:80
是否有可能以某种方式删除万维网从 HOST 标头的这一部分开始:
use_backend %[req.hdr(Host),lower] if own_backend
减少后端的数量?因为我不仅要写:“后端 sub1.example.com”,还要写这个“后端 www.sub1.example.com”。