仅允许某个网段访问某个虚拟目录路径

方法一:

http-request deny if { path_beg -i /powershell } !{ src 10.0.0.0/8 192.168.120.0/24 }

方法二:

acl allow_ip src 192.168.0.0/16 10.0.0.0/8
acl path_ps path_beg -i /powershell
block if path_ps !allow_ip

 

定义白名单列表:

cl ip_whitelist src -f /usr/local/haproxy/config/whitelist.acl
http-request allow if ip_whitelist