一位高人给的SQUID配置文件

#基本配置
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 to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
icp_access allow all

#cachemgr_passwd 123456 all
#squid 主要配置区 regedit 2009-01-17

#squid运行端口(绑定外网网址)
http_port xxx.xxx.xxx:80 vhost vport
visible_hostname Cache.ib100.com
icp_port 0

#发布一台后台服务器
#配置192.168.1.10为后端web服务器
cache_peer 192.168.1.10 parent 80 0 no-query originserver name=ib100
cache_peer_domain ib100 .ib100.com

#配置192.168.1.10为后端web服务器
cache_peer 192.168.1.10 parent 80 0 no-query originserver name=miss
cache_peer_domain miss .myioio.com.cn
cache_peer 127.0.0.1 parent 82 0 no-query originserver name=pg
cache_peer_domain pg .pg-xj.com

#配置127.0.0.1为后端web服务器
cache_peer 192.168.1.10 parent 80 0 no-query originserver name=thishost
cache_peer_domain thishost  .wisebi.com


#封IP
acl badip src "D:/squid/badip"
http_access deny badip

#开放ip权限
acl myip dst "D:/squid/ip"
http_access allow myip





acl iphorse urlpath_regex -i ip.txt$
http_access deny iphorse
deny_info  http://127.0.0.1/ip.txt  iphorse


#开放域名权限
acl mysite dstdomain "D:/squid/website"
http_access allow mysite

#禁止对xml文件缓存
acl xmlfile url_regex -i .xml$
cache deny xmlfile
acl rar url_regex -i .rar$
cache deny rar



acl PURGE method PURGE
http_access allow PURGE localhost
http_access deny PURGE


#失败请求存活时间
#禁止缓存404页
#negative_ttl 5 minutes
negative_ttl 1 second


#禁止所有没有规则的非法访问
http_access deny all

#日志设置
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh %{host}>h
access_log e:/squid/var/logs/access.log combined
#access_log null
cache_log e:/squid/var/logs/cache.log
cache_store_log e:/squid/var/logs/store.log
#cache_store_log null

#隐藏squid信息
header_access Via deny all
header_access Server deny all
header_access X-Cache deny all
header_access X-Cache-Lookup deny all
header_access X-Squid-Error deny all

httpd_suppress_version_string off

half_closed_clients off


hierarchy_stoplist cgi-bin ?
cache_mem 1024 MB
cache_swap_low 80
cache_swap_high 85

maximum_object_size_in_memory 800 KB

cache_dir ufs E:/Squid/var/cache 10240 16 256
#cache_dir null E:/Squid/var/cache

url_rewrite_host_header off

acl QUERY urlpath_regex cgi-bin ?
cache deny QUERY

#refresh_pattern -i .css$ 1440 50% 129600 reload-into-ims
#refresh_pattern -i .xml$ 1440 50% 129600 reload-into-ims
#refresh_pattern -i .html$ 1440 90% 129600 reload-into-ims-
#refresh_pattern -i .shtml$ 1440 90% 129600 reload-into-ims
#refresh_pattern -i .htm$ 1440 90% 129600 reload-into-ims
#refresh_pattern -i .jpg$ 1440 90% 129600 reload-into-ims
#refresh_pattern -i .png$ 1440 90% 129600 reload-into-ims
#refresh_pattern -i .gif$ 1440 90% 129600 ignore-reload
#refresh_pattern -i .bmp$ 1440 90% 129600 reload-into-ims
#refresh_pattern -i .js$ 1440 90% 129600 reload-into-ims

refresh_pattern -i (^ http://club .ib100.com)(.*?)(.html)$ 0    20%    4320
#refresh_pattern -i .html 1440 100% 129600 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private

#refresh_pattern -i .shtml 1440 100% 129600 override-expire override-lastmod reload-into-ims ignore-no-cache ignore-private
refresh_pattern ^ftp:        1440    20%    10080
refresh_pattern ^gopher:    1440    0%    1440
refresh_pattern .        0    20%    4320



#acl apache rep_header Server ^Apache
#broken_vary_encoding allow apache

#coredump_dir c:/squid/var/cache

你可能感兴趣的:(一位高人给的SQUID配置文件)