分享一個不錯的squid 設定檔

來源:互聯網
上載者:User

squid設定檔一例,只使用了web cache功能,用來給web加速。

http_port 80 defaultsite=IP
icp_port 0
cache_peer ip parent 85 0 no-query originserver
hosts_file /etc/hosts
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
cache_mem 2000 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
maximum_object_size_in_memory 1024 KB
cache_dir ufs /var/spool/squid 10000 64 256
emulate_httpd_log on
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
access_log /var/log/squid/access.log combined
cache_log none
cache_store_log none
refresh_pattern ^ftp: 10 20% 20
refresh_pattern ^gopher: 10 0% 20
refresh_pattern . 0 20% 20
refresh_pattern -i .html 10 100% 20 reload-into-ims
refresh_pattern -i .shtml 10 100% 20 reload-into-ims
refresh_pattern -i .htm 10 100% 20 reload-into-ims
refresh_pattern -i .gif 10 100% 20 reload-into-ims
refresh_pattern -i .swf 10 100% 20 reload-into-ims
refresh_pattern -i .png 10 100% 20 reload-into-ims
refresh_pattern -i .bmp 10 100% 20 reload-into-ims
refresh_pattern -i .css 10 100% 20 reload-into-ims
refresh_pattern -i .jpg 10 100% 20 reload-into-ims
refresh_pattern -i .txt 10 100% 20 reload-into-ims
refresh_pattern -i .rhtml 10 100% 20 reload-into-ims
refresh_pattern -i .xml 10 100% 20 reload-into-ims
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 to_servers dst IP
acl Safe_ports port 80
acl OverConnLimit maxconn 8
http_access deny OverConnLimit
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access allow to_servers
http_access deny all
http_reply_access allow all
icp_access allow all
visible_hostname cache15
cache_mgr admin@jbxue.COM
redirect_rewrites_host_header off
half_closed_clients off
allow_underscore on
pid_filename /usr/local/squaid/var/logs/squid.pid
logfile_rotate 10
coredump_dir /var/spool/squid
本文原始連結:http://www.jbxue.com/article/2176.html

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.