1

我想在 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页面,为什么?

4

1 回答 1

1

I'm using a slightly different method. I'm using the standard squid.conf file but changed the #acl localnet src 192.168.0.0/16 to my network IE: "192.168.1.0". Then search the conf file for the section that reads,

#deny_info TCP_RESET ads".  

just above the TCP_RESET line, add the following.

acl torrent dstdom_regex "/path/torrent_sites.txt"
http_access deny torrent
acl music dstdom_regex "/path/music_sites.txt"
http_access deny music

Now create 2 text files (/path/torrent_sites.txt and /path/music_sites.txt) that contain your URLs in the following format.

(^|\.)isohunt\.com$
(^|\.)thepiratebay\.org$
(^|\.)torrentz\.com$

etc.

sudo /etc/init.d/squid3 restart

or however else you want to restart it and everything should be good to go!

Blacklists can be found here: squid ACL examples & blacklist to download

于 2013-08-10T10:14:15.340 回答