centos Squid dstdom_regex不工作

h43kikqp  于 2022-11-08  发布在  其他
关注(0)|答案(1)|浏览(148)

我想拒绝所有的URL开始iso,在squid 3.2.3所以,我已经把在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

但是我可以进入www.example.com这个页面isohunt.com,为什么?

55ooxyrt

55ooxyrt1#

我使用的方法稍有不同,我使用的是标准的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

相关问题