Block downloading in Squid Proxy


In this tutorial i am going to block the downloading in squid proxy server.

#acl rule to block downloading
acl blockfiles urlpath_regex "/etc/squid/blockfiles"

#apply rule
http_access  allow limited_user !socialsites !blockfiles



Create file in server and paste the syntax
#vim /etc/squid/blockfiles
\.[Aa][Vv][Ii]$
\.[Mm][Pp][Gg]$
\.[Mm][Pp][Ee][Gg]$
\.[Mm][Pp]3$
\.[Mm][Pp]4$
\.3[Gg][Pp]$
\.mid
\.mp3$
\.3gp$
\.avi$
\.mp4$
\.mpg$
\.ram$
\.cab\?.*$
\.rm\?.*$
\.mp\?.*$
\.mpg\?.*$
\.mpeg\?.*$
\.mp3\?.*$
\.wmv\?.*$
\.wma\?.*$
\.mov\?.*$
\.avi\?.*$

#service squid reload

Share on Google Plus

About Penguin Technology

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

2 comments:

  1. I gathered as much knowledge regarding to the Linux, web sever and database server from your site.Keep on updating with more interesting topic.
    Moreover to recover the lost file from Linux Click on:
    android data recovery review
    launch android data recovery
    backup and restore android apps and data
    android backup app data
    recover lost files
    diskdigger pro file recovery

    ReplyDelete
  2. did you try your script when downloading extensions on HTTPS websites? try it and your code will fail!!!!

    ReplyDelete