我想限制在Squid代理的下载限制,所以我在squid.conf中添加了以下两行。
acl officelan dst 192.168.1.0/24
reply_body_max_size 30000000拒绝officelan
现在,我想允许一些/特定的IP下载超过30MB的限制,所以我包括另一个acl作为alowedip,包括以下行,但这是行不通的。
acl allowedip dst 192.168.1.81
reply_body_max_size 0 allow allowedip
如何让acl allowedip有无限的下载?
温暖的问候
Supratik
Squid按照自上而下写入conf文件的顺序检查匹配项。
确保
reply_body_max_size 0 allow allowedip
在之前
reply_body_max_size 30000000 allow officelan
如果你正在使用一个新的(> V3)版本的鱿鱼,那么就没有必要允许和拒绝例如
reply_body_max_size 0 allowedip reply_body_max_size 30000000 officelan
编辑
使用centos 5.5和squid 2.6.STABLE21 2台机器在与代理服务器相同的networking上进行testing。 以下是我的squid.conf中的相关条目
acl t1 src 192.168.254.200 acl t2 src 192.168.254.0/24 http_access allow t1 http_access allow t2 reply_body_max_size 0 allow t1 reply_body_max_size 100000 allow t2
这按预期工作 – 减less第二条语句中的字节大小(并重新启动squid)最终会导致squid拒绝传输。
只需重新sorting您的reply_body_max_size行。 鱿鱼检查他们的顺序。
这是从鱿鱼configuration文件:
When the reply headers are received, the reply_body_max_size lines are processed, and the first line with a result of "allow" is used as the maximum body size for this reply.