yum install squid -y
#vim /etc/squid/squid.conf
acl local src 192.168.0.0/24 //允许192.168.0.0/24网段内所有客户机访问代理服务器
http_access allow local //该记录一定要添在deny all之前
http_port 3128
# 这一行是定义
acl {定义名字} url_regex -i {关键字}
acl deny_keyword url_regex -i jd.com
# 这一行是调用自己定义的
http_access deny {定义名字}
http_access deny deny_keyword
# 定义好了 之后要重启 服务器
systemctl restart squid
systemctl start squid
systemctl enable squid
export http_proxy=http://192.168.0.109:3128
export https_proxy=http://192.168.0.109:3128
echo "export http_proxy=http://192.168.0.109:3128" >>/etc/profile
echo "export https_proxy=http://192.168.0.109:3128" >>/etc/profile
wget http://www.jd.com/index.php
可以看到 403
cat /var/log/squid/access.log
本章完结