frontend api01
bind *:22502
mode tcp
log global
default_backend api01pool
backend api01pool
balance roundrobin
tcp-request content accept if { src -f /etc/haproxy/iplist }
tcp-request content reject
server server1 127.0.0.1:22 check inter 5000 rise 2 fall 3 maxconn 3000
配置文件如上,加入2行
tcp-request content accept if { src -f /etc/haproxy/iplist }
tcp-request content reject
然后再/etc/haproxy/iplist里加入白名单