Home > linux > Example squid2013.conf

Example squid2013.conf

acl store_rewrite_list urlpath_regex \/(get_video|video\?v|videoplayback\?id|videoplayback.*id)
acl store_rewrite_list urlpath_regex \/(get_video\?|videodownload\?|videoplayback.*id|watch\?)
acl store_rewrite_list urlpath_regex \.(3gp|mp(3|4)|flv|(m|f)4v|on2|fid|avi|mov|wm(a|v)|(mp(e?g|a|e|1|2))|mk(a|v)|jp(e?g|e|2)|gif|png|tiff?|bmp|tga|svg|ico|swf|exe|ms(i|u|p)|cab|psf|mar|bin|z(ip|[0-9]{2})|r(ar|[0-9]{2})|7z)\?
acl store_rewrite_list_domain url_regex ^http:\/\/(([a-z-]+[0-9-]+)|([0-9-]+[a-z-]+))\.[a-z0-9-]*\.[a-z]{2,4}
acl store_rewrite_list_domain url_regex ^http:\/\/([a-zA-Z-]+[0-9-]+)\.[A-Za-z]*\.[A-Za-z]*
acl store_rewrite_list_domain url_regex (([a-z]{1,2}[0-9]{1,3})|([0-9]{1,3}[a-z]{1,2}))\.[a-z]*[0-9]?\.[a-z]{3}
acl store_rewrite_list_path urlpath_regex \.(3gp|mp(3|4)|flv|(m|f)4v|on2|fid|avi|mov|wm(a|v)|(mp(e?g|a|e|1|2))|mk(a|v)|jp(e?g|e|2)|gif|png|tiff?|bmp|tga|svg|ico|swf|exe|ms(i|u|p)|cab|psf|mar|bin|z(ip|[0-9]{2})|r(ar|[0-9]{2})|7z)$
acl store_rewrite_list_domain_CDN url_regex (cbk|mt|khm|mlt|tbn)[0-9]?.google\.co(m|\.uk|\.id)
acl store_rewrite_list_domain_CDN url_regex photos-[a-z].ak.fbcdn.net
acl store_rewrite_list_domain_CDN url_regex ^http:\/\/([a-z])[0-9]?(\.gstatic\.com|\.wikimapia\.org)
acl store_rewrite_list_domain_CDN url_regex ^http:\/\/[.a-z0-9]*\.photobucket\.com.*\.[a-z]{3}$
#acl store_rewrite_list_domain_CDN url_regex ^http:\/\/.*speedtest.*
acl store_rewrite_list_domain_CDN url_regex streamate.doublepimp.com.*\.js\? \.doubleclick\.net.* yieldmanager cpxinteractive quantserve\.com
acl speedtest_allow_url url_regex -i \.speedtest\.net\/ speedtest
acl speedtest_allow_url url_regex ^http:\/\/speedtest\.*
acl speedtest_allow_dom dstdomain .speedtest.net

acl dontrewrite url_regex (get_video|video\?v=|videoplayback\?id|videoplayback.*id).*begin\=[1-9][0-9]* \.php\? \.asp\? \.aspx\? threadless.*\.jpg\?r=
acl getmethod method GET

storeurl_access deny dontrewrite
storeurl_access deny !getmethod

storeurl_access allow store_rewrite_list_domain_CDN
storeurl_access allow store_rewrite_list
storeurl_access allow store_rewrite_list_domain store_rewrite_list_path
storeurl_access allow speedtest_allow_url
storeurl_access allow speedtest_allow_dom
storeurl_access deny all
storeurl_rewrite_program /usr/local/share/squid/supercache.pl
storeurl_rewrite_children 4
storeurl_rewrite_concurrency 10

acl DENYCACHE urlpath_regex \.(ini|ui|lst|inf|pak|ver|patch|md5|cfg|lst|list|rsc|log|conf|dbd|db)$
acl DENYCACHE urlpath_regex (notice.html|afs.dat|dat.asp|patchinfo.xml|version.list|iepngfix.htc|updates.txt|patchlist.txt)
acl DENYCACHE urlpath_regex (pointblank.css|login_form.css|form.css)$
acl DENYCACHE urlpath_regex (Loader|gamenotice|sources|captcha|notice|reset)
cache deny DENYCACHE

refresh_pattern \.facebook\.com.*\.(jp(e?g|e|2)|gif|png|tiff?|bmp|swf|mp(4|3)) 43800 99999% 43200 override-expire ignore-reload ignore-no-cache ignore-private ignore-no-store ignore-must-revalidate store-stale
refresh_pattern \.fbcdn\.net.*\.(jp(e?g|e|2)|gif|png|tiff?|bmp|swf|mp(4|3)) 43800 99999% 43800 override-expire ignore-reload ignore-no-cache ignore-private ignore-no-store ignore-must-revalidate store-stale negative-ttl=0
refresh_pattern ^.*safebrowsing.*google 2629742 999999% 2629742 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth ignore-must-revalidate negative-ttl=10080 store-stale

#ads
refresh_pattern ^.*(streamate.doublepimp.com.*\.js\?|utm\.gif|ads\?|rmxads\.com|ad\.z5x\.net|bh\.contextweb\.com|bstats\.adbrite\.com|a1\.interclick\.com|ad\.trafficmp\.com|ads\.cubics\.com|ad\.xtendmedia\.com|\.googlesyndication\.com|advertising\.com|yieldmanager|game-advertising\.com|pixel\.quantserve\.com|adperium\.com|doubleclick\.net|adserving\.cpxinteractive\.com|syndication\.com|media.fastclick.net).* 2629742 20% 2629742 ignore-no-cache ignore-no-store ignore-private override-expire ignore-reload ignore-auth ignore-must-revalidate store-stale negative-ttl=40320 max-stale=1440

refresh_pattern (get_video\?|videoplayback\?|videodownload\?|watch\?\.flv?|.vid\?) 2629742 99999999% 2629742 override-expire ignore-reload ignore-must-revalidate ignore-no-cache ignore-no-store ignore-private store-stale negative-ttl=0
refresh_pattern (\.swf\?|\.avi\?|\.mov\?|\.wm(a|v)\?|\.3gp\?|\.mp(4|3)\?|\.rm\?|\.ram\?|\.m4v\?|\.on2\?) 43200 999999% 2629742 override-expire ignore-reload ignore-must-revalidate ignore-no-cache ignore-no-store ignore-private store-stale negative-ttl=0
refresh_pattern \.(ico|video-stats) 2629742 999999% 2629742 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth override-lastmod ignore-must-revalidate negative-ttl=10080 store-stale

refresh_pattern (photobucket|pbsrc|flickr|yimg|ytimg|twimg|gravatar)\.com.*\.(jp(e?g|e|2)|gif|png|tiff?|bmp|swf|mp(4|3)) 2629742 999999% 2629742 override-expire ignore-reload ignore-no-cache ignore-private ignore-no-store ignore-must-revalidate store-stale
refresh_pattern ^http:\/\/images|image|img|pics|openx|thumbs[0-9]\. 2629742 999999% 2629742 override-expire ignore-reload ignore-no-cache ignore-private ignore-no-store ignore-must-revalidate store-stale
refresh_pattern (zynga|ninjasaga|mafiawars|cityville|farmville|crowdstar|spilcdn|agame|popcap)\.com/.* 2629742 999999% 2629742 override-expire ignore-reload ignore-no-cache ignore-private ignore-no-store ignore-must-revalidate store-stale
refresh_pattern \.(akamaihd|edgecastcdn|spilcdn|zgncdn|(tw|y|yt)img)\.com.*\.(jp(e?g|e|2)|gif|png|swf|mp(3|4)) 43200 99999% 43200 override-expire override-lastmod ignore-reload ignore-no-cache ignore-private ignore-must-revalidate store-stale
refresh_pattern \.gstatic\.com/images\? 43200 99999% 43200 override-expire override-lastmod ignore-reload ignore-no-cache ignore-private ignore-must-revalidate store-stale
refresh_pattern (gstatic|diggstatic)\.com/.* 2629742 999999% 2629742 override-expire ignore-reload ignore-no-cache ignore-private ignore-no-store ignore-must-revalidate store-stale
refresh_pattern ^http://((cbk|mt|khm|mlt|tbn)[0-9]?)\.google\.co(m|\.uk|\.id) 43200 999999% 43200 override-expire override-lastmod ignore-reload ignore-no-cache ignore-private ignore-auth ignore-must-revalidate ignore-no-store negative-ttl=10080 store-stale
refresh_pattern vid\.akm\.dailymotion\.com.*\.on2\? 2629742 999999% 2629742 ignore-no-cache override-expire override-lastmod store-stale
refresh_pattern \.speedtest/.* 43200 99999% 432000 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-must-revalidate store-stale
refresh_pattern galleries\.video(\?|sz) 2629742 999999% 2629742 override-expire ignore-reload ignore-no-cache ignore-must-revalidate ignore-private store-stale
refresh_pattern \.wikimapia\.org\/? 43200 99999% 43200 override-expire override-lastmod ignore-reload ignore-no-cache ignore-private ignore-must-revalidate store-stale
refresh_pattern \.(rackcdn|spilcdn|zgncdn)\.com.*\.(jp(e?g|e|2)|gif|png|swf|mp(3|4)) 43200 9999% 43200 override-expire ignore-reload ignore-no-cache store-stale
refresh_pattern code.googlec.com.*(svn|download) 0 50% 1440 reload-into-ims

#sensitive site
refresh_pattern -i \.(sc-|dl-|ex-|mh-|dll|da-|iop) 0 5% 60 reload-into-ims
refresh_pattern -i \.(mst|Xtp)$ 0 50% 1440 reload-into-ims
refresh_pattern -i (main.exe|update.exe|grandchase.exe|FSLauncher.exe|FreeStyle_Setup.exe|grandchase.exe|filelist.zip|autoupgrade.exe)$ 0 50% 1440 reload-into-ims
refresh_pattern -i (UpdaterModifier.exe|FreeStyle.exe|PBLauncher.exe|update.exe|NewLauncher.exe|NewAvalon.exe|hon.exe.zip|cabal.exe)$ 0 50% 1440 reload-into-ims
refresh_pattern -i (PointBlank.exe.zip|HSUpdate.exe.zip|PBConfig.exe.zip) 0 50% 1440 reload-into-ims
refresh_pattern -i (wks_avira-win32-en-pecl.info.gz|wks_avira10-win32-en-pecl.info.gz)$ 0 50% 1440 reload-into-ims
refresh_pattern -i (setup.exe.gz|avscan.exe.gz|avguard.exe.gz|filelist.zip|AvaClient.exe) 0 50% 1440 reload-into-ims
refresh_pattern -i (livescore.com|goal.com|bobet) 0 50% 60 reload-into-ims

#antivirus
refresh_pattern avast.com.*\.vpx 40320 90% 161280 ignore-reload ignore-no-cache ignore-no-store store-stale ignore-must-revalidate reload-into-ims
refresh_pattern (avgate|avira).*\.(idx|gz)$ 1440 90% 1440 ignore-reload ignore-no-cache ignore-no-store store-stale ignore-must-revalidate
refresh_pattern kaspersky.*\.avc$ 2629742 999999% 2629742 ignore-reload store-stale
refresh_pattern kaspersky 1440 50% 161280 ignore-no-cache store-stale

#general
refresh_pattern \.(jp(e?g|e|2)|tiff?|bmp|gif|png) 2629742 999999% 2629742 ignore-no-cache ignore-no-store reload-into-ims override-expire ignore-private ignore-must-revalidate store-stale
refresh_pattern \.(z(ip|[0-9]{2})|r(ar|[0-9]{2})|jar|bz2|gz|tar|rpm|vpu) 2629742 999999% 2629742 override-expire reload-into-ims ignore-no-cache ignore-private ignore-must-revalidate ignore-no-store store-stale
refresh_pattern \.(mp3|wav|og(g|a)|flac|midi?|rm|aac|wma|mka|ape) 2629742 999999% 2629742 override-expire reload-into-ims ignore-reload ignore-no-cache ignore-private ignore-must-revalidate ignore-no-store store-stale
refresh_pattern \.(exe|msi|msp|msu|dmg|bin|xpi|iso|swf|mar|psf|cab) 2629742 999999% 2629742 override-expire reload-into-ims ignore-reload ignore-no-cache ignore-private ignore-must-revalidate ignore-no-store store-stale
refresh_pattern \.(mpeg|ra?m|avi|mp(g|e|4)|mov|divx|asf|wmv|m\dv|rv|vob|asx|ogm|flv|3gp|on2) 2629742 999999% 2629742 override-expire override-lastmod ignore-reload ignore-no-cache ignore-private ignore-auth ignore-must-revalidate ignore-no-store negative-ttl=0 store-stale
refresh_pattern -i (cgi-bin) 0 0% 0
refresh_pattern \.(php|jsp|cgi|asx|asp|aspx)\? 0 0% 0
refresh_pattern ^ftp: 40320 20% 40320 override-expire reload-into-ims store-stale
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 50% 40320 store-stale

Categories: linux
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: