- 論壇徽章:
- 0
|
visible_hostname www.gxpx.com
http_port 211.71.189.190:3128 vhost vport
#http_port 81 vhost
visible_hostname www.gxpx.com
#xx.xx.xx.xx為這臺(tái)服務(wù)器的IP地址
icp_port 0
cache_mem 400 MB
#設(shè)置Squid所能使用的內(nèi)存共400MB,這個(gè)值因人而異
cache_swap_low 90
cache_swap_high 95
maximum_object_size 20000 KB
#最大緩存文件大小,超過(guò)這個(gè)值則不緩存,這個(gè)值因人而異
maximum_object_size_in_memory 4096 KB
cache_dir ufs /var/log/squid/cache 10000 16 256
#磁盤(pán)緩存的類型和目錄,大小,一二級(jí)目錄的設(shè)置,這里磁盤(pán)緩存大小是10G
cache_store_log none
#這個(gè)設(shè)置是不記錄store.log
emulate_httpd_log on
#打開(kāi)emulate_httpd_log選項(xiàng),將使Squid仿照Aapche的日志格式
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
#日志格式combined的設(shè)置
pid_filename /var/log/squid/squid.pid
cache_log /var/log/squid/cache.log
access_log /var/log/squid/access.log combined
#這里是設(shè)置pid和日志文件的位置,因人而異,同時(shí)日志格式是combined,awstats可以直接調(diào)用分析了
acl all src 0.0.0.0/0.0.0.0
acl Safe_ports port 80
acl QUERY urlpath_regex cgi-bin .php .cgi .avi .wmv .rm .ram .mpg .mpeg .zip .exe
cache deny QUERY
#設(shè)置不想緩存的目錄或者文件類型
#acl picurl url_regex -i \.bmp$ \.png$ \.jpg$ \.gif$ \.jpeg$
#acl mystie1 referer_regex -i aaa
#http_access allow mystie1 picurl
#acl mystie2 referer_regex -i bbb
#http_access allow mystie2 picurl
#設(shè)置防圖片盜鏈的,其中aaa,和bbb分別是虛擬主機(jī)的域名,referer中必須包含有aaa或者bbb的域名才能訪問(wèn)圖片
#acl nullref referer_regex -i ^$
#http_access allow nullref
#acl hasref referer_regex -i .+
#http_access deny hasref picurl
#設(shè)置允許直接訪問(wèn)圖片和拒絕referer中沒(méi)有包含aaa或著bbb的訪問(wèn)圖片 |
|