首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Squid3封锁除受限站点外的所有站点

Squid3封锁除受限站点外的所有站点
EN

Server Fault用户
提问于 2015-06-07 11:50:57
回答 1查看 6K关注 0票数 0

我有一个配置文件,在允许和限制站点的行中,我有以下内容:

代码语言:javascript
运行
复制
acl AllowedSites dstdomain "/home/john/squid3_sites/allowed-sites.squid"
acl RestrictedSites dstdomain "/home/john/squid3_sites/restricted-sites.squid"

然后在我的http_access名单上,我

代码语言:javascript
运行
复制
http_access allow AllowedSites
http_access deny RestrictedSites

我所允许的站点的内容。sites只是一个*来代表所有站点允许的区域。在我的限制网站上只有"www.facebook.com“。代理限制除facebook.com以外的所有站点。当我去任何我能想到的网站时,我会得到访问被拒绝的错误站点。如果有帮助,下面是我完整的http_access列表:

代码语言:javascript
运行
复制
http_access allow AllowedSites
http_access deny RestrictedSites
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all

我所有的acls:

代码语言:javascript
运行
复制
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
EN

回答 1

Server Fault用户

发布于 2015-06-08 00:28:52

就像很多基于允许/拒绝规则的系统一样,一旦一个规则匹配,它就被应用了,并且该规则链没有进一步的处理。因此,一旦你允许*,它甚至永远不会得到任何后续的拒绝规则,为该链。或者如文件所述:

根据写入的顺序检查访问列表规则。一旦其中一条规则匹配,列表搜索就会终止。

一旦用实际的列表替换了*,它就能工作了。如果您通过deny all跟踪它,您也不需要一个拒绝站点列表。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/697203

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档