设为首页 收藏本站
查看: 1402|回复: 0

[经验分享] squid 限制内网用户 只能登陆,不能上传

[复制链接]

尚未签到

发表于 2018-12-28 06:27:21 | 显示全部楼层 |阅读模式
  操作没有成功, 能查询,但还是不能登陆!
  有点网站,登陆与上传的都是 method="post"动作
http_access allow local_rd_network rd_allow_url
http_access allow local_rd_network rd_post_url
http_access allow local_rd_network rd_get_url Get
http_access allow local_rd_network allowfile

如何限制?


网友摘录:
============================>

近日,小弟将公司squid2.7升级到了3.1,但是不知如何实现“部分上传大小限制”!
  尝试过用request_body_max_size 30 KB,但是很遗憾这是一个全局变量,无法做例外,一但加到squid.conf里面所有IP都无法上传30KB以上的文件。
  坛子里高手如云,有哪位大虾在“squid3.0+”中做过限制部分IP上传大小的,可否指点一二?



还是把方案贴出来吧,给大伙参考下下!
acl my_net 10.0.0.0/32
acl UPLIMIT req_header Content-Length [5-9][0-9]{5} [0-9]{7,}
acl UPLOAD method post ftp
http_access deny my_net UPLIMIT UPLOAD












Re: [squid-users] How to limit upload for a particular source ip/user?



  • This message: [ Message body ] [ More options ]
  • Related messages: [ Next message ] [ Previous message ] [ In reply to ] [ Next in thread ] [ Replies ]



From: Abu Khaled  
Date: Sat, 20 Aug 2005 09:39:39 +0300  On 8/20/05, Senthil Murugan  wrote:
> Thanks for your prompt response. I should have asked you clearly. I was
> thought of limiting the file size of the upload. I think using delay pools
> we can limit the bandwidth for a particular user.... I thought of using the
> "request_body_max_size" to control the upload size, but it is a general
> configuration parameter which is applicable for all the users.
>
> Syntax:
> # TAG: request_body_max_size (KB)
>
> But for limiting download size i think we can use "reply_body_max_size"
> with acl capabilities
>
> # TAG: reply_body_max_size bytes allow|deny acl acl...
>
> I like to know if there is any way in which we can control the upload size
> for a particular user
>
> -SenthilMurugan
>
>
> >> How to limit the upload for a particular user/source ip?
> >>
> >AFAIK squid delay pools only affect incomming traffic (download) and
> >have no effect on the outgoing traffic (upload).
> >
> >Regards.
> >Abu Khaled
>
>
  Seems like I did not cc the list on my first reply !!!
Here is how I was able to block uploads larger than 500KB:

  acl my_net src 10.0.0.1/255.255.255.0
acl USERA src 10.0.0.1/255.255.255.255
acl UPLIMIT req_header Content-Length [5-9][0-9]{5,}
acl UPMETH method post
http_access deny USERA UPMETH UPLIMIT
http_access allow my_net
http_access deny_all

  PS: Though I was able to block the uploads the traffic still hits
squid (eq: 2MB) before it displays the deny page


--
Regards.
Abu Khaled

Received on Sat Aug 20 2005 - 00:39:41 MDT



  • This message: [ Message body ]
  • Next message: Roman Rathler: "Re: [squid-users] configuring Squid to authenticate AND to log users' access to forbidden sites."
  • Previous message: Abu Khaled: "Re: [squid-users] Squidguard.cgi problem"
  • In reply to: Senthil Murugan: "[squid-users] How to limit upload for a particular source ip/user?"
  • Next in thread: Joost de Heer: "Re: [squid-users] How to limit upload for a particular source ip/user?"
  • Reply: Joost de Heer: "Re: [squid-users] How to limit upload for a particular source ip/user?"


  • Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]



This archive was generated by hypermail pre-2.1.9 : Thu Sep 01 2005 - 12:00:02 MDT






运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-656593-1-1.html 上篇帖子: 解决squid启动Pinger自动退出问题 下篇帖子: squid client长连接,怎么忽略keep
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表