每文档,如果使用 dstdomain 并且列表中有重叠条目,Squid 应该生成警告消息。例如,我的 中有这个/etc/squid/squid.conf
:
acl dst_domains dstdomain "/etc/squid/dst_domains.txt"
http_access allow localnet dst_domains
并且/etc/squid/dst_domains.txt
包含重叠,如下所示:
.googlecloud.com
.updates.googlecloud.com
test.updates.googlecloud.com
确实会导致出现警告信息/var/log/squid/cache.log
:
2023/09/08 19:31:21 kid1| WARNING: '.updates.googlecloud.com' is a subdomain of '.googlecloud.com'
2023/09/08 19:31:21 kid1| WARNING: You should remove '.updates.googlecloud.com' from the ACL named 'dst_domains'
2023/09/08 19:31:21 kid1| WARNING: 'test.updates.googlecloud.com' is a subdomain of '.googlecloud.com'
2023/09/08 19:31:21 kid1| WARNING: You should remove 'test.updates.googlecloud.com' from the ACL named 'dst_domains'
但这里有一个类似的重叠:
us-docker.pkg.dev
.pkg.dev
这反而会触发错误并导致 squid 终止:
2023/09/08 19:47:47 kid1| ERROR: 'us-docker.pkg.dev' is a subdomain of '.pkg.dev'
2023/09/08 19:47:47 kid1| ERROR: You need to remove 'us-docker.pkg.dev' from the ACL named 'dst_domains'
2023/09/08 19:47:47 kid1| storeDirWriteCleanLogs: Starting...
2023/09/08 19:47:47 kid1| Finished. Wrote 0 entries.
2023/09/08 19:47:47 kid1| Took 0.03 seconds ( 0.00 entries/sec).
2023/09/08 19:47:47 kid1| FATAL: Bungled /etc/squid/squid.conf line 57: acl dst_domains dstdomain "/etc/squid/dst_domains.txt"
2023/09/08 19:47:47 kid1| Squid Cache (Version 4.13): Terminated abnormally.
有人能解释一下这种行为吗?实际上,这似乎与一般触发器警告有更具体的重叠,但具体之后是生成触发器错误。
答案1
找到我的回答;所以这是预期的(但不受欢迎的)行为: