visible_hostname 153.test.cache.net
header_replace Server NCache/1.1
http_port 80 vhost http11
#cache_dir aufs /mnt/squid/squid_cache 61200 16 256
cache_dir aufs /mnt/squid/cache 30720 16 128
cache_mem 4096 MB
cache_mgr abcserver@hotmail.com
cache_swap_low 90
cache_swap_high 95
maximum_object_size 10240 KB
minimum_object_size 1 bytes
maximum_object_size_in_memory 64 KB
#logformat combined %{X-Forwarded-For}>h %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh %{host}>h %tr
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh %{host}>h %tr
cache_access_log /mnt/squid/log/access.log combined
#cache_access_log /var/log/squid/access.log combined
#cache_log /mnt/squid/log/cache.log
#cache_store_log /mnt/squid/log/store.log
referer_log /mnt/squid/log/referer.log
logfile_rotate 30
connect_timeout 10 seconds
persistent_request_timeout 30 seconds
request_timeout 20 seconds
#----------------------------------------------------------------------------------------
# 配置SNMP访问
#----------------------------------------------------------------------------------------
#acl abc_iplist src "/etc/squid/squid_abc_acl.conf"
#acl mmxx_iplist src "/etc/squid/squid_mmxx_acl.conf"
acl denykey url_regex -i -mmxxSales-
#acl baidu referer_regex -i baidu\.com
acl all src 0/0
acl manager proto cache_object
acl KeyPurge method PURGE
acl CactiServer src 192.168.1.233 127.0.0.1
acl SNMP snmp_community public
header_access Via deny all
header_access Server deny all
#http_access deny baidu
#http_access deny abc_iplist
#http_access deny mmxx_iplist
http_access allow manager KeyPurge
http_access allow all
# 不缓存页面【规则】
cache deny denykey
# cancel snmp moon.2012.07.23
#snmp_port 3401
#snmp_access allow SNMP CactiServer
#snmp_access deny all
#----------------------------------------------------------------------------------------
cache_peer 192.168.1.222 parent 80 0 no-query originserver name=abc_com
cache_peer_domain abc_com www.abc.com
cache_peer_access abc_com allow all
cache_peer 192.168.1.222 parent 80 0 no-query originserver name=abc1_com
#cache_peer 192.168.1.110 parent 80 0 no-query originserver name=abc1_com
cache_peer_domain abc1_com abc.com
cache_peer_access abc1_com allow all
cache_peer 192.168.1.222 parent 80 0 no-query originserver name=abc_www3
cache_peer_domain abc_www3 www3.abc.com
cache_peer_access abc_www3 allow all
cache_peer 192.168.1.222 parent 80 0 no-query originserver name=abc_www1
cache_peer_domain abc_www1 www1.abc.com
cache_peer_access abc_www1 allow all
cache_peer 192.168.1.222 parent 80 0 no-query originserver name=abc_image
cache_peer_domain abc_image image.abc.com
cache_peer_access abc_image allow all
#bygaga.mmx for haproxy, moon 2012.09.24
acl abcds dstdomain .abc.com
cache_peer 192.168.1.222 parent 80 0 no-query originserver name=abcothers
cache_peer_access abcothers allow abcds
#----------------------------------------------------------------------------------------
cache_peer 192.168.1.222 parent 80 0 no-query originserver name=mmxx_com
cache_peer_domain mmxx_com www.mmxx.com
cache_peer_access mmxx_com allow all
cache_peer 192.168.1.222 parent 80 0 no-query originserver name=mmxx1_com
cache_peer_domain mmxx1_com mmxx.com
cache_peer_access mmxx1_com allow all
cache_peer 192.168.1.222 parent 80 0 no-query originserver name=mmxx_image
cache_peer_domain mmxx_image image.mmxx.com
cache_peer_access mmxx_image allow all
#----------------------------------------------------------------------------------------
cache_peer 192.168.1.222 parent 80 0 no-query originserver name=bygaga_com
cache_peer_domain bygaga_com www.bygaga.com
cache_peer_access bygaga_com allow all
cache_peer 192.168.1.222 parent 80 0 no-query originserver name=bygaga1_com
cache_peer_domain bygaga1_com bygaga.com
cache_peer_access bygaga1_com allow all
cache_peer 192.168.1.222 parent 80 0 no-query originserver name=bygaga_image
cache_peer_domain bygaga_image image.bygaga.com
cache_peer_access bygaga_image allow all
refresh_pattern -i \.css$ 600 60% 720 ignore-reload
refresh_pattern -i \.js$ 60 90% 70 ignore-reload
refresh_pattern -i \.html$ 1380 60% 1440 ignore-reload
refresh_pattern -i \.htm$ 1380 60% 1440 ignore-reload
refresh_pattern -i \.jpg$ 600 90% 720 ignore-reload
refresh_pattern -i \.png$ 600 90% 720 ignore-reload
refresh_pattern -i \.gif$ 600 90% 720 ignore-reload
refresh_pattern -i \.bmp$ 600 90% 720 ignore-reload
refresh_pattern -i \.cfm$ 600 90% 720 ignore-reload
自定义错误路径:
vi /usr/share/squid-langpack/en/ERR_ACCESS_DENIED