Linux 限制 Squid 只访问一个站点

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10599122/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 06:19:46  来源:igfitidea点击:

Restrict Squid access to only one site

linuxubuntusquid

提问by Fenelon

How do I restrict access to only one websitethrough my Squid proxy?

如何通过我的 Squid 代理限制对一个网站的访问

The following doesn't work...

以下不起作用...

acl amazon_ireland src 79.125.0.0/17
acl some_site url_regex google

http_access allow amazon_ireland
http_access allow some_site
http_access deny all

采纳答案by dwalter

Have a look at the squid FAQ, there is a perfect example for your setup.

看看鱿鱼常见问题,有一个完美的例子适合您的设置。

Squid FAQ

鱿鱼常见问题

 acl GOOD dst 10.0.0.1
 http_access allow GOOD
 http_access deny all

if you want to match by domain-name

如果你想通过域名匹配

 acl GOOD dstdomain .amazon.ie
 http_access allow GOOD
 http_access deny all

回答by Cleber Reizen

Here is another way, where you can specify the source IP addres. And block specific sites such as youtube facebook

这是另一种方法,您可以在其中指定源 IP 地址。并阻止特定网站,例如 youtube facebook

acl liberaip src 130.44.0.215
acl block url_regex -i youtube facebook
http_access allow liberaip !block