傅令江的光影色彩世界
squid做前端服务器的配置
2014-7-13 令狐江
visible_hostname host2
#设定squid的主机名,如无此项squid将无法启动
http_port 80 accel vhost vport
#设定squid为accel加速模式,vhost必须要加.否则将无法将主机头转发至后端服务器,访问时就会出现无法找到主机头的错误
#domains(以下为加速的站点)
acl Safe_ports port 80
acl Purge method PURGE
cache_peer 127.0.0.1 parent 81 0 no-query originserver name=site181
cache_peer 127.0.0.1 parent 81 0 no-query originserver login=PASS
#peer_domain
cache_dir ufs /var/spool/squid 1024 16 256
cache_mem 256 MB #定义不同的父节点,将节点设为no-query以及originserver说明这些节点是实际服务器
cache_peer_domain site181 .jp .com .cn .net
#设定不同域名转发到不同的cache_peer上,如果没有这项.不同域名的域名可能被分发到同一台服务器上.
#acl broken302 http_status 400-404 302
#http_access deny Broken302
#acl all src 0.0.0.0/0.0.0.0
http_access allow all
#允许所有客户端访问
#cache_log /var/log/squid/cache.log
#cache_access_log /var/log/squid/access.log
#记录日志
#***********ACL存取控制*************
#acl QueryString url_regex .php
#***********缓冲存取控制*************
#no_cache deny QueryString
#no_cache allow QueryString
acl QUERY urlpath_regex -i \?
no_cache deny QUERY
maximum_object_size_in_memory 1024 KB
cache_mgr f@163.com
#cache_effective_user nobody
#cache_effective_group nobody
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容