squid.conf 配置文件样例 for squid-2.6

http_port 80 transparent

cache_replacement_policy lru
cache_dir aufs /log/squid/cache1 8192 16 256
cache_dir aufs /log/squid/cache2 4096 16 256
cache_mem 2048 MB
maximum_object_size 2048 KB
maximum_object_size 1 MB
maximum_object_size_in_memory 512 KB

visible_hostname cache.ccc.com

client_persistent_connections off
server_persistent_connections on
#persistent_connection_after_error on

memory_pools on
memory_pools_limit 1024 MB

forwarded_for on
log_icp_queries off
#reload_into_ims off
#half_closed_clients off
cache_mgr [email protected]
via on
httpd_suppress_version_string off


cache_effective_user squid
cache_effective_group squid

error_directory /usr/local/squid/share/errors/Simplify_Chinese
icon_directory /usr/local/squid/share/icons
mime_table /usr/local/squid/etc/mime.conf


ie_refresh off
tcp_recv_bufsize 32 KB

acl all src 0.0.0.0/0.0.0.0
acl localhost src 127.0.0.0/8
acl Mgr_ip src 127.0.0.0/8
acl allow_ip dst 127.0.0.0/8  192.168.0.0/16
acl Purge_ip src 127.0.0.0/8  192.168.0.0/16
acl PURGE method PURGE
acl allow_Domain dstdomain .ccc.com
acl Safe_ports port 80 8080
acl CONNECT method CONNECT
acl manager proto cache_object
acl HTTP proto HTTP

http_access allow allow_Domain
http_access allow allow_ip
http_access allow manager Mgr_ip
http_access deny manager
http_access allow PURGE Purge_ip
http_access deny PURGE
http_access deny !Safe_ports
http_access deny all
icp_access deny all

#cache_peer 127.0.0.1 parent 80 0 no-query no-digest no-netdb-exchange originserver name=BLOG
#acl BLOG_DOMAIN dstdom_regex .*\.blog\.ccc\.com
#cache_peer_access BLOG allow BLOG_DOMAIN

ipcache_size 1024
ipcache_low 90
ipcache_high 95

memory_replacement_policy lru

#hosts_file /etc/hosts
request_header_max_size 128 KB

hierarchy_stoplist cgi-bin ? \.php \.html
acl QUERY urlpath_regex cgi-bin \? \.php \.html
cache deny QUERY

request_body_max_size 0 KB

refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
#refresh_pattern .               0       50%     1440
#refresh_pattern -i \.jpg$       1440    50%     2880      ignore-reload
#refresh_pattern -i \.png$       1440    50%     2880      ignore-reload
#refresh_pattern -i \.bmp$       1440    50%     2880      ignore-reload
#refresh_pattern -i \.gif$       1440    50%     2880      ignore-reload
#refresh_pattern -i \.jpeg$      1440    50%     2880      ignore-reload
#refresh_pattern -i \.swf$       1440    50%     2880      ignore-reload
#refresh_pattern -i \.js$        1440    50%     2880      ignore-reload
#refresh_pattern -i \.css$       1440    50%     2880      ignore-reload
refresh_pattern -i \.zip$       1440    50%     2880      ignore-reload

quick_abort_min -1 KB
quick_abort_max 32 KB
quick_abort_pct 95

# error page
#error_map http://www.ccc.net/error/404.html 403
#deny_info http://www.ccc.net/aaa.html ccc_Domain

# timeout
peer_connect_timeout 20 seconds
connect_timeout 20 seconds
#connect_timeout 1 minute
#negative_ttl 0 minutes
read_timeout 60 seconds
#read_timeout 15 minutes
request_timeout 20 seconds
#request_timeout 30 minutes
pconn_timeout 20 seconds
#pconn_timeout 1 minutes
#collapsed_forwarding on
#persistent_request_timeout 20 minute
#persistent_request_timeout 1 minutes
##client_lifetime 1 day
#client_lifetime 2 minutes
#shutdown_lifetime 30 seconds
shutdown_lifetime 5 seconds
strip_query_terms off

# snmp
#snmp_port 3401
#acl snmppublic snmp_community show
#snmp_access allow snmppublic localhost
#snmp_access deny all
icp_port 0

# logfile
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 none
#access_log /log/squid-log/access.log combined
#cache_store_log /log/squid-log/store.log
cache_store_log /dev/null
cache_log /log/squid-log/cache.log
logfile_rotate 12

# MISCELLANEOUS
store_objects_per_bucket 15
client_db off

添加新评论 »