我有一个配置文件,在允许和限制站点的行中,我有以下内容:
acl AllowedSites dstdomain "/home/john/squid3_sites/allowed-sites.squid"
acl RestrictedSites dstdomain "/home/john/squid3_sites/restricted-sites.squid"然后在我的http_access名单上,我
http_access allow AllowedSites
http_access deny RestrictedSites我所允许的站点的内容。sites只是一个*来代表所有站点允许的区域。在我的限制网站上只有"www.facebook.com“。代理限制除facebook.com以外的所有站点。当我去任何我能想到的网站时,我会得到访问被拒绝的错误站点。如果有帮助,下面是我完整的http_access列表:
http_access allow AllowedSites
http_access deny RestrictedSites
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all我所有的acls:
acl SSL_ports port 443 563
acl AllowedSites dstdomain “/usr/local/etc/allowed-sites.squid”
acl RestrictedSites dstdomain “/usr/local/etc/restricted-sites.squid”
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl all src all发布于 2015-06-08 00:28:52
就像很多基于允许/拒绝规则的系统一样,一旦一个规则匹配,它就被应用了,并且该规则链没有进一步的处理。因此,一旦你允许*,它甚至永远不会得到任何后续的拒绝规则,为该链。或者如文件所述:
根据写入的顺序检查访问列表规则。一旦其中一条规则匹配,列表搜索就会终止。
一旦用实际的列表替换了*,它就能工作了。如果您通过deny all跟踪它,您也不需要一个拒绝站点列表。
https://serverfault.com/questions/697203
复制相似问题