haproxy IP白名单

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里加入白名单

 

posted @ 2020-08-28 16:29  鸾舞春秋  阅读(722)  评论(0编辑  收藏  举报