始创于2000年 股票代码:831685
咨询热线:0371-60135900 注册有礼 登录
  • 挂牌上市企业
  • 60秒人工响应
  • 99.99%连通率
  • 7*24h人工
  • 故障100倍补偿
您的位置: 网站首页 > 帮助中心>文章内容

分享squid缓存服务器配置

发布时间:  2012/7/25 18:33:10

分享下自己测试squid缓存节点配置文件:
  squid版本:
  Squid Cache: Version 3.1.5
  http_port 80 vhost
  http_port 8080 vhost vport
  icp_port 0
  unique_hostname host57
  dns_nameservers  192.168.1.100
  cache_dir aufs /data/cache/cache1 40960 16 256 max-size=204800
  cache_dir aufs /data/cache/cache2 40960 16 256 max-size=204800
  logformat  cdn  %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %>Hs %<st %tr "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
  cache_log /data/cache/logs/cache.log
  access_log /data/cache/logs/access.log  cdn
  cache_store_log none
  cache_effective_user squid
  cache_effective_group  squid
  tcp_recv_bufsize 65535 bytes
  logfile_rotate 4
  pid_filename /usr/local/squid/var/logs/squid.pid
  cache_mem  2048 MB
  cache_swap_low 85
  cache_swap_high 95
  maximum_object_size 4096 KB
  maximum_object_size_in_memory 512 KB
  reply_body_max_size 5116 KB
  minimum_object_size 1 bytes
  ipcache_size 65535
  fqdncache_size 65535
  cache_replacement_policy heap LFUDA
  memory_replacement_policy heap LFUDA
  request_header_max_size 32 KB
  quick_abort_min -1 KB
  read_ahead_gap 16 KB
  negative_ttl 0 minutes
  range_offset_limit -1 KB
  client_lifetime 60 minutes
  half_closed_clients off
  pconn_timeout 100 seconds
  shutdown_lifetime 20 seconds
  cache_mgr admin@5iqiong.com
  httpd_suppress_version_string off
  visible_hostname 51cdn.cn
  memory_pools_limit 64 MB
  via off
  forwarded_for on
  store_avg_object_size 32 KB
  store_objects_per_bucket 256
  strip_query_terms off
  coredump_dir /data/cache/logs
  ################Purge#########################
  acl AdminBoxes src 127.0.0.1
  acl Purge method PURGE
  http_access allow AdminBoxes Purge
  http_access deny Purge
  hierarchy_stoplist cgi-bin ?
  hierarchy_stoplist -i ^https:\\ ?
  acl QUERY urlpath_regex -i cgi-bin \? \.php \.xml \.jsp \.js \.do
  acl denyssl urlpath_regex -i ^https:\\
  acl dy_cache urlpath_regex swf\?
  acl dy_cache urlpath_regex html\?
  acl dy_cache urlpath_regex htm\?
  acl dy_cache urlpath_regex exe\?
  acl dy_cache urlpath_regex css\?
  acl dy_cache urlpath_regex js\?
  acl dy_cache urlpath_regex cab\?
  acl dy_cache urlpath_regex asp\?
  acl dy_cache urlpath_regex aspx\?
  acl dy_cache urlpath_regex php\?
  acl dy_cache urlpath_regex jsp\?
  acl dy_page url_regex -i ^http:\/\/www1\.5iqiong\.com\/.*\?.*$
  acl dy_page url_regex -i ^http:\/\/www2\.5iqong\.com\/.*\?.*$
  no_cache deny QUERY
  no_cache deny denyssl
  no_cache deny dy_cache
  no_cache deny dy_page
  acl www dstdomain .eqifa.net
  always_direct allow www
  http_access allow www
  ##############Refresh_pattern#################
  refresh_pattern -i ^http:\/\/(www1|www2)\.5iqiong\.com\/.*\.(html|jpeg|bmp|png|gif)  120 100%  240 reload-into-ims
  refresh_pattern -i \/$ 15 90% 600 reload-into-ims
  refresh_pattern -i \.html$ 15 90% 60 reload-into-ims
  refresh_pattern -i \.htm$ 15 90% 600 reload-into-ims
  refresh_pattern -i \.shtml$ 15 90% 600 reload-into-ims
  refresh_pattern -i \.vhtml$ 30 90% 600 reload-into-ims
  refresh_pattern -i \.hml$ 15 90% 600 reload-into-ims
  refresh_pattern -i \.php$ 1440 90% 129600 reload-into-ims
  refresh_pattern -i \.asp$ 15 90% 600 reload-into-ims
  refresh_pattern -i \.jsp$ 1440 90% 8640 reload-into-ims
  refresh_pattern -i \.gif$ 1440 90% 129600 reload-into-ims
  refresh_pattern -i \.swf$ 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 \.bmp$ 1440 90% 129600 reload-into-ims
  refresh_pattern -i \.js$ 120 90% 600 reload-into-ims
  refresh_pattern -i \.css$ 120 90% 600 reload-into-ims
  refresh_pattern -i \.wma 1440 90% 21600 reload-into-ims
  refresh_pattern -i \.zip 1440 90% 21600 reload-into-ims
  refresh_pattern -i \.mp3 1440 90% 21600 reload-into-ims
  refresh_pattern -i \.rar 1440 90% 21600 reload-into-ims
  refresh_pattern -i \.flv$ 1440 90% 21600 reload-into-ims
  refresh_pattern -i \.wmv$ 1440 90% 21600 reload-into-ims
  refresh_pattern -i \.exe$ 1440 90% 21600 reload-into-ims
  refresh_pattern .               0       20%     4320
  acl manager proto cache_object
  acl ownhost src 192.168.1.0/24
  acl localhost src 127.0.0.1/32
  acl to_localhost dst 127.0.0.0/8
  acl Safe_ports port 8080    # proxy
  acl Safe_ports port 80      # Web
  acl SSL_ports port  443     #https
  acl CONNECT method CONNECT
  http_access allow ownhost
  http_access allow manager localhost
  http_access deny manager
  http_access deny !Safe_ports
  http_access deny CONNECT !SSL_ports
  http_access deny all
  icp_access allow  all
  ##############http-header###############################
  reply_header_access Via deny all
  reply_header_access Cache-Control deny all
  reply_header_access Server deny all
  reply_header_access X-Squid-Error deny all
  reply_header_access X-Forwarded-For deny all
  request_header_access Via deny all
  request_header_access Age deny all
  request_header_access X-Squid-Error deny all
  request_header_access Pragma deny all
  #request_header_access X-Forwarded-For deny all

亿恩科技地址(ADD):郑州市黄河路129号天一大厦608室 邮编(ZIP):450008 传真(FAX):0371-60123888
   联系:亿恩小凡
   QQ:89317007
   电话:0371-63322206


本文出自:亿恩科技【www.enkj.com】

服务器租用/服务器托管中国五强!虚拟主机域名注册顶级提供商!15年品质保障!--亿恩科技[ENKJ.COM]

  • 您可能在找
  • 亿恩北京公司:
  • 经营性ICP/ISP证:京B2-20150015
  • 亿恩郑州公司:
  • 经营性ICP/ISP/IDC证:豫B1.B2-20060070
  • 亿恩南昌公司:
  • 经营性ICP/ISP证:赣B2-20080012
  • 服务器/云主机 24小时售后服务电话:0371-60135900
  • 虚拟主机/智能建站 24小时售后服务电话:0371-60135900
  • 专注服务器托管17年
    扫扫关注-微信公众号
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 亿恩科技 版权所有  地址:郑州市高新区翠竹街1号总部企业基地亿恩大厦  法律顾问:河南亚太人律师事务所郝建锋、杜慧月律师   京公网安备41019702002023号
      0
     
     
     
     

    0371-60135900
    7*24小时客服服务热线