Squid 2.7 conf for Windows ? MaxGO Inside…

来源:百度文库 编辑:神马文学网 时间:2024/06/03 04:37:13

http_port 80 vhost vport=80
cache_dir ufs D:\squid\var\cache 5120 16 256 #缓存的目录 大小是5G,第一级目录是16个,第二级目录是256个
cache_mem 256 MB #squid使用的内存大小

#cache.log 设置 日志文件存放位置
cache_store_log none
cache_access_log C:\squid\var\logs\access.log
cache_log C:\squid\var\logs\cache.log
error_directory C:\squid\share\errors\Simplify_Chinese

#cache.log 告警
#high_response_time_warning 1500

hosts_file C:\WINDOWS\system32\drivers\etc\hosts
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache

#所需缓存文件文件扩展名
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
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 \.mp3$ 1440 50% 2880 ignore-reload
refresh_pattern -i \.wmv$ 1440 50% 2880 ignore-reload
refresh_pattern -i \.rm$ 1440 50% 2880 ignore-reload
refresh_pattern -i \.swf$ 1440 50% 2880 ignore-reload
refresh_pattern -i \.mpeg$ 1440 50% 2880 ignore-reload
refresh_pattern -i \.wma$ 1440 50% 2880 ignore-reload
refresh_pattern -i \.rar$ 1440 50% 2880 ignore-reload
refresh_pattern -i \.zip$ 1440 50% 2880 ignore-reload
refresh_pattern -i \.7z$ 1440 50% 2880 ignore-reload
refresh_pattern -i \.pdf$ 1440 50% 2880 ignore-reload
refresh_pattern -i \.exe$ 1440 50% 2880 ignore-reload
refresh_pattern -i \.doc$ 1440 50% 2880 ignore-reload
refresh_pattern -i \.txt$ 1440 50% 2880 ignore-reload
refresh_pattern . 120 50% 1440

#访问控制
acl d-domains dstdomain .maxgo.org #允许域名 多个域名用,分开 允许所有*.maxgo.org访问
acl all src 0.0.0.0/0.0.0.0
acl p-manager proto cache_object
acl s-localhost src 127.0.0.1/255.255.255.255
acl d-localhost dst 127.0.0.0/8
acl p-ssl port 443 563
acl p-safe port 80 443 563 70 210 280 488 591 777 1025-65535 #安全端口
acl m-conn method CONNECT
acl m-purge method PURGE
acl n-maxconn maxconn 15 #每ip最大连接数
http_access allow p-manager s-localhost
http_access allow m-purge
http_access allow p-manager
http_access allow d-domains
http_access deny !p-safe
http_access deny m-conn !p-ssl
http_access deny n-maxconn
http_access deny all
http_reply_access allow all
acl r-url urlpath_regex realtime
cache deny r-url
icp_access allow all
#主机名
visible_hostname www.maxgo.org
logfile_rotate 0
always_direct allow all
#管理联系信息
cache_mgr maxgo.cn#gmail.com

      添加了一些注释,简单的修改后直接就能使用。有什么问题可以在下面留言,大家共同讨论。