免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2526 | 回复: 4

[proxy] squid如何限制下载大小不成功... [复制链接]

论坛徽章:
0
发表于 2007-02-06 15:38 |显示全部楼层
acl wireless src 192.168.xxx.xxx
reply_body_max_size 5120000 deny wireless
限制在5M,但测试不成功...

论坛徽章:
0
发表于 2007-02-06 17:59 |显示全部楼层
Can I prevent users from downloading large files?

You can set the global reply_body_max_size parameter. This option controls the largest HTTP message body that will be sent to a cache client for one request.

If the HTTP response coming from the server has a Content-length header, then Squid compares the content-length value to the reply_body_max_size value. If the content-length is larger, the server connection is closed and the user receives an error message from Squid.

Some responses don't have Content-length headers. In this case, Squid counts how many bytes are written to the client. Once the limit is reached, the client's connection is simply closed.

Note that "creative" user-agents will still be able to download really large files through the cache using HTTP/1.1 range requests


官网的FAQ有这么一说

论坛徽章:
0
发表于 2007-02-12 18:31 |显示全部楼层
acl UPLIMIT req_header Content-Length [5-9][0-9]{5} [0-9]{7,}

That should block anything =>; 500KB.
Note that the Content-Length header is in bytes.

acl UPLIMIT req_header Content-Length [0-9]{8,}
should block anything >;= 10000000 (10MB)


这个方法也无果...

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
发表于 2007-02-16 15:14 |显示全部楼层

论坛徽章:
0
发表于 2007-02-16 17:24 |显示全部楼层
acl wireless src 192.168.xxx.xxx
reply_body_max_size 5120000 allow wireless

改成这样,5M以下得都可以下载,超过5M得统统不行
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP