Now there is a requirement is that in the release of the company's IP outside the network when the access to the service is denied access
Now use Haproxy's ACL rules to make restrictions
ErrorFile 403/etc/haproxy/errfile/403.http
ACL Url_bao HDR (Host)-I bao.doyoulicai.comacl kongzhong_src src 222.73.17.25 222.73.17.24http-request deny if Url_jr!kongzhong_srcuse_backend bao.doyoulicai.com if url_baobackend bao.doyoulicai.com balance roundrobin option httpchk get/test http/1.0 Server 10.9.6.18:6011 10.9.6.18:6011 check Inter 60000 rise 2 Fall 5 weight 10
By setting this, you can deny access to the 403 page directly when the IP address is accessed bao.doyoulicai.com other than 222.73.17.25 222.73.17.24.
And now customize the 403 page
[[Email protected]_ha_nginx errfile]# cat 403.http http/1.0 403 forbiddencache-control:no-cacheconnection: closecontent-type:text/html<! DOCTYPE html>Haproxy deny access by using ACL rules to block custom IP addresses