我想在 squid 3.2.3 中拒绝所有以 iso 开头的 URL
所以,我放入了 squid.conf:
acl torrent_sites dstdom_regex -i iso
acl music_sites dstdom_regex -i music
和我的 http 控件,如:
http_access allow localhost
http_access allow localnetp1
http_access deny torrent_sites localnetp1
http_access deny music_sites
http_access deny ftp_request
http_access deny localnetp1 norm_conn
http_access deny all
但是我可以进入isohunt.com页面,为什么?
最佳答案
我正在使用稍微不同的方法。我正在使用标准的 squid.conf 文件,但更改了 #acl localnet src 192.168.0.0/16
到我的网络 IE:“192.168.1.0”。然后在 conf 文件中搜索读取的部分,
#deny_info TCP_RESET ads".
只是 以上 TCP_RESET 行,添加以下内容。
acl torrent dstdom_regex "/path/torrent_sites.txt"
http_access deny torrent
acl music dstdom_regex "/path/music_sites.txt"
http_access deny music
现在创建 2 个文本文件(
/path/torrent_sites.txt
和 /path/music_sites.txt
),其中包含以下格式的 URL。(^|\.)isohunt\.com$
(^|\.)thepiratebay\.org$
(^|\.)torrentz\.com$
等等
sudo /etc/init.d/squid3 restart
或者你想重新启动它,一切都应该很好!
黑名单可以在这里找到:squid ACL examples & blacklist to download
关于proxy - 鱿鱼 dstdom_regex 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13690011/