
gstatic.com
Squidでウェブサイトをブロックしたいのですが、アクセスを許可したいですgstatic.com/recaptcha/*
。ホワイトリストに以下を記録します。
gstatic\.com/recaptcha/*
動作しません。ドメイン名を作成するとき:
gstatic\.com
ウェブサイト全体へのアクセスを許可します。
イカ.conf:
http_access allow manager localhost
http_access deny manager
acl bad_domain dstdom_regex "/etc/squid/block.acl"
acl good_domain dstdom_regex "/etc/squid/white.acl"
http_access deny bad_domain
http_access allow good_domain
http_access deny all
答え1
これには3つの顕著なエラーがあります。
許可ルールは拒否前に表示する必要があります。
dstdom_regex
URLのホスト名部分とのみ一致し、他のすべてのエントリは無視されます。代わりに、url_regex
またはこれが必要な場合がありますurlpath_regex
。dstdom_regex "/etc/squid/white.acl"
あなたが思うようにはなりません。複数のaclを含むファイルはロードされません。これを行うには、1行に1つのacl定義を持つファイルを作成し、include
それをsquid.confに入れる必要があります。include /etc/squid/white.acl
dstdom_regex "/etc/squid/block.acl"