18 March 2012

squid.conf (3)

http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex -i cgi-bin \? localhost
#acl QUERY urlpath_regex -i cgi-bin \? \.php$ \.asp$ \.shtml$ \.cfm$ \.cfml$ \.phtml$ \.php3$ localhost
# dns_nameservers 127.0.0.1 192.168.34.1 203.130.208.18 202.134.0.155
cache deny QUERY
cache_mem 750 MB
cache_vary on
cache_swap_low 97
cache_swap_high 99
maximum_object_size 1024 MB
maximum_object_size_in_memory 1 KB
ipcache_low 97
ipcache_high 99
icp_port 0
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF
cache_dir aufs /squid-1 7000 16 256
cache_dir aufs /squid-2 7000 16 256
cache_dir aufs /squid-3 7000 16 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /dev/null
logfile_rotate 1

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl router src 192.168.3.0/255.255.255.0
acl warnet src 70.70.70.0/255.255.255.0

acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http

acl purge method PURGE
acl CONNECT method CONNECT

snmp_port 3401
acl snmppublic snmp_community public
snmp_access allow snmppublic all

http_access allow purge all
http_access allow manager all
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow warnet
http_access allow router
http_access deny all
http_reply_access allow all

acl store_rewrite_list urlpath_regex \/(get_video|videoplayback\?id|videoplayback.*id) \.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|wmv|3gp|mp(4|3)|exe|msi|zip|on2|mar|swf)\?
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 \.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|avc|zip|mp3|3gp|rar|on2|mar|exe)$
acl store_rewrite_list_domain_CDN url_regex streamate.doublepimp.com.*\.js\? photos-[a-z].ak.fbcdn.net \.rapidshare\.com.*\/[0-9]*\/.*\/[^\/]* ^http:\/\/(www\.ziddu\.com.*\.[^\/]{3,4})\/(.*) \.doubleclick\.net.* yieldmanager cpxinteractive ^http:\/\/[.a-z0-9]*\.photobucket\.com.*\.[a-z]{3}$ quantserve\.com

acl videocache_allow_url url_regex -i \.youtube\.com\/get_video\?
acl videocache_allow_url url_regex -i \.youtube\.com\/videoplayback \.youtube\.com\/videoplay \.youtube\.com\/get_video\?
acl videocache_allow_url url_regex -i \.youtube\.[a-z][a-z]\/videoplayback \.youtube\.[a-z][a-z]\/videoplay \.youtube\.[a-z][a-z]\/get_video\?
acl videocache_allow_url url_regex -i \.googlevideo\.com\/videoplayback \.googlevideo\.com\/videoplay \.googlevideo\.com\/get_video\?
acl videocache_allow_url url_regex -i \.google\.com\/videoplayback \.google\.com\/videoplay \.google\.com\/get_video\?
acl videocache_allow_url url_regex -i \.google\.[a-z][a-z]\/videoplayback \.google\.[a-z][a-z]\/videoplay \.google\.[a-z][a-z]\/get_video\?
acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/videoplayback\?
acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/videoplay\?
acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/get_video\?
acl videocache_allow_url url_regex -i proxy[a-z0-9\-][a-z0-9][a-z0-9][a-z0-9]?\.dailymotion\.com\/
acl videocache_allow_url url_regex -i vid\.akm\.dailymotion\.com\/
acl videocache_allow_url url_regex -i [a-z0-9][0-9a-z][0-9a-z]?[0-9a-z]?[0-9a-z]?\.xtube\.com\/(.*)flv
acl videocache_allow_url url_regex -i bitcast\.vimeo\.com\/vimeo\/videos\/
acl videocache_allow_url url_regex -i va\.wrzuta\.pl\/wa[0-9][0-9][0-9][0-9]?
acl videocache_allow_url url_regex -i \.files\.youporn\.com\/(.*)\/flv\/
acl videocache_allow_url url_regex -i \.msn\.com\.edgesuite\.net\/(.*)\.flv
acl videocache_allow_url url_regex -i media[a-z0-9]?[a-z0-9]?[a-z0-9]?\.tube8\.com\/ mobile[a-z0-9]?[a-z0-9]?[a-z0-9]?\.tube8\.com\/ www\.tube8\.com\/(.*)\/
acl videocache_allow_url url_regex -i \.mais\.uol\.com\.br\/(.*)\.flv
acl videocache_allow_url url_regex -i \.video[a-z0-9]?[a-z0-9]?\.blip\.tv\/(.*)\.(flv|avi|mov|mp3|m4v|mp4|wmv|rm|ram)
acl videocache_allow_url url_regex -i video\.break\.com\/(.*)\.(flv|mp4)
acl videocache_allow_dom dstdomain .mccont.com .metacafe.com .redtube.com .cdn.dailymotion.com

acl dontrewrite url_regex redbot\.org (get_video|videoplayback\?id|videoplayback.*id).*begin\=[1-9][0-9]*
acl getmethod method GET

storeurl_access allow videocache_allow_url
storeurl_access allow videocache_allow_dom

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 deny all
storeurl_rewrite_program /etc/squid/store_url_rewrite
storeurl_rewrite_children 2
storeurl_rewrite_concurrency 40

max_stale 1 week

refresh_pattern (get_video\?|videoplayback\?|videodownload\?|\.flv?) 20160 99% 20160 ignore-no-cache ignore-private reload-into-ims store-stale ignore-must-revalidate
refresh_pattern (get_video\?|videoplayback\?id|videoplayback.*id|videodownload\?|\.flv?) 20160 99% 20160 ignore-no-cache ignore-private reload-into-ims store-stale ignore-must-revalidate

#All File
#refresh_pattern -i \.(3gp|7z|ace|asx|bin|deb|divx|dvr-ms|ram|rpm|exe|inc|cab|qt) 10080 99% 43200 ignore-no-cache ignore-private reload-into-ims store-stale ignore-must-revalidate
#refresh_pattern -i \.(rar|jar|gz|tgz|bz2|iso|m1v|m2(v|p)|mo(d|v)|arj|lha|lzh|zip|tar) 10080 99% 43200 ignore-no-cache ignore-private reload-into-ims store-stale ignore-must-revalidate
#refresh_pattern -i \.(jp(e?g|e|2)|gif|pn[pg]|bm?|tiff?|ico|swf|dat|ad|txt|dll) 10080 99% 43200 ignore-no-cache ignore-private reload-into-ims store-stale ignore-must-revalidate
#refresh_pattern -i \.(avi|ac4|mp(e?g|a|e|1|2|3|4)|mk(a|v)|ms(i|u|p)|og(x|v|a|g)|rm|r(a|p)m|snd|vob) 10080 99% 43200 ignore-no-cache ignore-private reload-into-ims store-stale ignore-must-revalidate
#refresh_pattern -i \.(pp(t?x)|s|t)|pdf|rtf|wax|wm(a|v)|wmx|wpl|cb(r|z|t)|xl(s?x)|do(c?x)|flv|x-flv) 10080 99% 43200 ignore-no-cache ignore-private reload-into-ims store-stale ignore-must-revalidate

refresh_pattern -i \.(ht(m?l)|shtml|xml|css|js|class|jar|xml|cfm)$ 720 40% 10080 ignore-no-cache ignore-private reload-into-ims store-stale ignore-must-revalidate

refresh_pattern -i \.(7z|arj|bin|bz2|cab|dll|exe|gz|inc|iso|jar|lha|ms(i|p|u)|rar|rpm|tar|tgz|zip)$ 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims store-stale ignore-must-revalidate
refresh_pattern -i \.(class|css|doc|docx|js|pdf|pps|ppt|ppsx|pptx|ps|rtx|txt|wpl|xls|xlsx)$ 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims store-stale ignore-must-revalidate
refresh_pattern -i \.(3gp|ac4|agx|au|avi|axd|bmp|cbr|cbt|cbz|dat|divx|flv|gif|hqx|ico|jp(2|e|eg|g)|mid|mk(a|v)|mov|mp(1|2|3|4|e|eg|g)|og(a|g|v)|png|qt|ra|ram|rm|swf|tif|tiff|wa(v|x)|wm(a|v|x)|x-flv)$ 1440 99% 14400 override-expire override-lastmod ignore-no-cache ignore-private reload-into-ims store-stale ignore-must-revalidate
refresh_pattern ^ftp: 100080 95% 2419200 reload-into-ims override-lastmod
refresh_pattern -i \.(html|htm|css|js)$ 1440 75% 14400 store-stale ignore-must-revalidate
refresh_pattern -i \.index.(html|htm)$ 0 75% 10080 store-stale ignore-must-revalidate
refresh_pattern (cgi-bin|\?) 0 0% 0
refresh_pattern -i \update.ini 0 0% 0
refresh_pattern \.(php|jsp|cgi|asx)\? 0 0% 0
refresh_pattern . 1440 99% 14400 ignore-no-cache ignore-private reload-into-ims store-stale

half_closed_clients off
dns_timeout 1 minutes
check_hostnames off
negative_ttl 0 second
positive_dns_ttl 12 hour
negative_dns_ttl 1 minute

quick_abort_min 0
cachemgr_passwd disable config delay offline_toggle shutdown reconfigure
cachemgr_passwd none all
strip_query_terms off
maximum_single_addr_tries 5
retry_on_error off
ie_refresh off
range_offset_limit 0
zero_buffers on
server_http11 on

quick_abort_max 0
quick_abort_pct 98
shutdown_lifetime 5 second
store_avg_object_size 13 KB

client_db on
max_filedesc 1500
memory_pools off
log_icp_queries off
icp_hit_stale off
query_icmp off
reload_into_ims on
coredump_dir /var/spool/squid
pipeline_prefetch on
vary_ignore_expire on

zph_mode tos
zph_local 0x30
zph_parent 0
zph_option 136

cache_effective_user proxy
cache_effective_group proxy
unique_hostname proxy
visible_hostname proxy
cache_mgr alvisadelio@home.org
Previous Post
Next Post
Related Posts

1 comment: