- 论坛徽章:
- 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为这台服务器的IP地址
icp_port 0
cache_mem 400 MB
#设置Squid所能使用的内存共400MB,这个值因人而异
cache_swap_low 90
cache_swap_high 95
maximum_object_size 20000 KB
#最大缓存文件大小,超过这个值则不缓存,这个值因人而异
maximum_object_size_in_memory 4096 KB
cache_dir ufs /var/log/squid/cache 10000 16 256
#磁盘缓存的类型和目录,大小,一二级目录的设置,这里磁盘缓存大小是10G
cache_store_log none
#这个设置是不记录store.log
emulate_httpd_log on
#打开emulate_httpd_log选项,将使Squid仿照Aapche的日志格式
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
#日志格式combined的设置
pid_filename /var/log/squid/squid.pid
cache_log /var/log/squid/cache.log
access_log /var/log/squid/access.log combined
#这里是设置pid和日志文件的位置,因人而异,同时日志格式是combined,awstats可以直接调用分析了
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
#设置不想缓存的目录或者文件类型
#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
#设置防图片盗链的,其中aaa,和bbb分别是虚拟主机的域名,referer中必须包含有aaa或者bbb的域名才能访问图片
#acl nullref referer_regex -i ^$
#http_access allow nullref
#acl hasref referer_regex -i .+
#http_access deny hasref picurl
#设置允许直接访问图片和拒绝referer中没有包含aaa或着bbb的访问图片 |
|