0

Based On squid's wiki:
"Squid's access control scheme is relatively comprehensive and difficult for some people to understand. There are two different components: ACL elements, and access lists. An access list consists of an allow or deny action followed by a number of ACL elements.

When loading the configuration file Squid processes all the acl lines (directives) into memory as tests which can be performed against any request transaction. Types of tests are outlined in the next section ACL Elements. By themselves these tests do nothing. For example; the word "Sunday" matches a day of the week, but does not indicate which day of the week you are reading this."
This post related to store-id.pl configuration, this post about squid.conf setting. Place the scripts under http access options, these are the steps:

1. Backup Your Squid.conf
# cp /etc/squid/squid.conf /etc/squid/old-squid.conf

2. Edit Squid.conf
# nano /etc/squid/squid.conf

acl store-id-pl url_regex -i ^http.*\.(fbcdn|akamaihd)\.net\/h(profile|photos).*[\d\w].*\/([\w]\d+x\d+\/.*\.[\d\w]{3}).*
acl store-id-pl url_regex -i ^http(.*)static(.*)(akamaihd|fbcdn).net\/rsrc.php\/(.*\/.*\/(.*).(js|css|png|gif))(\?(.*)|$)
acl store-id-pl url_regex -i ^https?:\/\/[a-zA-Z0-9\-\_\.\%]*(fbcdn|akamaihd)[a-zA-Z0-9\-\_\.\%]*net\/rsrc\.php\/(.*)
acl store-id-pl url_regex -i ^https?\:\/\/.*(profile|photo|creative).*\.ak\.fbcdn\.net\/((h|)(profile|photos)-ak-)(snc|ash|prn)[0-9]?(.*)
acl store-id-pl url_regex -i ^https?:\/\/.*(profile|photo|creative)*.akamaihd\.net\/((h|)(profile|photos|ads)-ak-)(snc|ash|prn|frc[0-9])[0-9]?(.*)
acl store-id-pl url_regex -i ^https?\:\/\/video\.(.*)\.fbcdn\.net\/(.*?)\/([0-9_]+\.(mp4|flv|avi|mkv|m4v|mov|wmv|3gp|mpg|mpeg)?)(.*)
acl store-id-pl url_regex -i ^https?\:\/\/.*utm.gif.*
acl store-id-pl url_regex -i ^https?\:\/\/.*\/speedtest\/(.*\.(jpg|txt)).*
acl store-id-pl url_regex -i ^https?\:\/\/.*\/(.*\..*(mp4|3gp|flv))\?.*
acl store-id-pl url_regex -i ^https?\:\/\/c2lo\.reverbnation\.com\/audio_player\/ec_stream_song\/(.*)\?.*
acl store-id-pl url_regex -i ^https?\:\/\/.*\.c\.android\.clients\.google\.com\/market\/GetBinary\/GetBinary\/(.*\/.*)\?.*
acl store-id-pl url_regex -i ^http:\/\/([a-z])[0-9]?(\.gstatic\.com.*|\.wikimapia\.org.*)
acl store-id-pl url_regex -i ^https://www.google.co(.id|m)/images/.*.(jpg|jpeg|swf|png|gif|bmp|js|css)
acl store-id-pl url_regex -i ^https?:\/\/.*(googleusercontent.com|blogspot.com)\/(.*)\/([a-z0-9]+)(-[a-z]-[a-z]-[a-z]+)?\/(.*\.(jpg|png))
acl store-id-pl url_regex -i ^https?:\/\/([a-z0-9.]*)(\.doubleclick\.net|\.quantserve\.com|.exoclick\.com|interclick.\com|\.googlesyndication\.com|\.auditude\.com|.visiblemeasures\.com|yieldmanager|cpxinteractive)(.*)
acl store-id-pl url_regex -i ^http\:\/\/.*\.4shared\.com\/download\/(.*)\/.*
acl store-id-pl url_regex -i ^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*?)
acl store-id-pl url_regex -i ^https?\:\/\/i[1-4]\.ytimg\.com\/(.*)
acl store-id-pl url_regex -i ^https?\:\/\/lh[0-9]?.ggpht.com\/(.*?)\/(.*?)\/(.*?)\/(.*)\/(.*)?$
acl store-id-pl url_regex -i filehippo && ^https?:\/\/(.*?)\.(.*?)\/(.*?)\/(.*)\.([a-z0-9]{3,4})(\?.*)?
acl store-id-pl url_regex -i ^http:\/\/.*dlink__[23]Fdownload_[23]F([\w\d-]+)_3Ftsid.*
acl store-id-pl url_regex -i ^https?\:\/\/[^\/]*\.vimeo[^\/]*\.com.*\/([[^\/]*\.(flv|mp4|avi|mkv|mp3|rm|rmvb|m4v|mov|wmv|3gp|mpg|mpeg|web))\?.*
acl store-id-pl url_regex -i c.android.clients.google.com.market.GetBinary.GetBinary.*
acl store-id-pl url_regex -i youtube.*(ptracking|stream_204|player_204|gen_204).*$
acl store-id-pl url_regex -i ^https:\/\/.*\.(googlevideo)\.com\/(watch|get_video|videodownload|videoplayback|videoplay|generate_204|videogoodput)\?.*
acl store-id-pl-path urlpath_regex \/(get_video\?|videodownload\?|videoplayback.*id)
acl store-id-pl-path urlpath_regex \/ads\?
acl store-id-pl-path urlpath_regex \.(mp2|mp3|mid|midi|mp[234]|wav|ram|ra|rm|au|3gp|m4r|m4a)\?
acl store-id-pl-path urlpath_regex \.(mpg|mpeg|mp4|m4v|mov|avi|asf|wmv|wma|dat|flv|swf)\?
acl store-id-pl-path urlpath_regex \.(jpeg|jpg|jpe|jp2|gif|tiff?|pcx|png|bmp|pic|ico)\? 
acl store-id-pl url_regex ^http:\/\/([A-Za-z-]+[0-9]+)*\.[A-Za-z]*\.[A-Za-z]*
acl store-id-pl_CDN url_regex ^http:\/\/[a-z]+[0-9]\.google\.com doubleclick\.net
acl store-id-pl-path urlpath_regex \.(mp2|mp3|mid|midi|mp[234]|wav|ram|ra|rm|au|3gp|m4r|m4a)$
acl store-id-pl-path urlpath_regex \.(mpg|mpeg|mp4|m4v|mov|avi|asf|wmv|wma|dat|flv|swf)$
acl store-id-pl-path urlpath_regex \.(jpeg|jpg|jpe|jp2|gif|tiff?|pcx|png|bmp|pic|ico)$
store_id_access allow store-id-pl
store_id_access allow store-id-pl-path
store_id_access deny !CONNECT
store_id_access deny all

(Use ctrl + x than y, to end the editing scripts and exit on nano)

3. Reload Your Squid Proxy Configuration
# squid -k reconfigure
Next
This is the most recent post.
Previous
Older Post

Post a Comment

 
Top