Chinaunix首页 | 论坛 | 博客
  • 博客访问: 929740
  • 博文数量: 245
  • 博客积分: 11429
  • 博客等级: 上将
  • 技术积分: 2662
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-15 00:16
文章存档

2011年(56)

2010年(174)

2009年(15)

分类: LINUX

2011-03-28 17:37:27

squid 3.1.8 如何支持http1.1之前用的是squid2.6,但是对http11 支持不好,虽然squid2.7 设置参数可以支持http11,但是这些都是部分的。
看了下squid版本之间的对比,说squid3.0.xx 以上对http11完美支持。
squid3.0 添加httpd_accel_uses_host_header on //设定http1.1协议支持 应该可以,我没测过,既然选择选择个高点版本,要不就推荐使用2.7.

           我采用squid3.1.8 虽然默认支持http11. 但是我获取header头信息还是http1.0,
  
几个对http11相关说明的参数有:
#  TAG: vary_ignore_expire      on|off
#       Many HTTP servers supporting Vary gives such objects
#       immediate expiry time with no cache-control header
#       when requested by a HTTP/1.0 client. This option
#       enables Squid to ignore such expiry times until
#       HTTP/1.1 is fully implemented.
#
#       WARNING: If turned on this may eventually cause some
#       varying objects not intended for caching to get cached.
#Default:
# vary_ignore_expire off
#  TAG: via     on|off
#       If set (default), Squid will include a Via header in requests and
#       replies as required by RFC2616.
#Default:
# via on

还有其他几个参数和后端服务有关的keepalive

但我获取的信息一致都是1.0
如:
响应头
响应头信息格式化头信息
HTTP/1.0 200 OKServer: nginx/0.7.67Date: Fri, 25 Mar 2011 06:25:04 GMTContent-Type: text/htmlX-Cache: MISS from jfeiyang3X-Cache-Lookup: MISS from f:80Via: 1.0 f3 (squid/3.1.8)Connection: close

请求头
GET /html/index.shtml HTTP/1.1Host: test.feiyang.ccUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: zh-cn,zh;q=0.5Accept-Encoding: gzip,deflateAccept-Charset: GB2312,utf-8;q=0.7,*;q=0.7Keep-Alive: 115Connection: keep-aliveCookie: user_ident=1301016306161063


[b]附上配置文件[/b]

http_port 80 accel vhost vport transparent
#http_port 80 accel  vhost vport
icp_port 0
udp_incoming_address 0.0.0.0
udp_outgoing_address 255.255.255.255
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY

#ignore_expect_100 off
#httpd_accel_uses_host_header on
reply_header_max_size 64 KB
chunked_request_body_max_size 64 KB
request_body_max_size 0 KB
uri_whitespace encode
persistent_request_timeout 2 minute
client_persistent_connections on
server_persistent_connections on
via on
vary_ignore_expire off
#request_entities off
#strip_query_terms off
#server http11 on
persistent_request_timeout 5 seconds
client_persistent_connections off
server_persistent_connections on
forwarded_for on
acl apache rep_header Server ^Apache
#broken_vary_encoding allow apache
cache_mem 500 MB
maximum_object_size 16384 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 384 KB
negative_ttl 1 second
cache_replacement_policy lru
memory_replacement_policy lru

cache_dir ufs /usr/local/cache2 2000 64 256
#logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv"  %h" "%{User-Agent}>h" %Ss:%Sh
#logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %h" "%{User-Agent}>h" %Ss:%Sh %{host}>h
logformat combined %>a %ui %un [%tl] "%rm %ru  HTTP/%rv" %Hs %h" "%{User-Agent}>h" %Ss:%Sh %tr
strip_query_terms off
cache_access_log /usr/local/squid3.1/squidlogs/access.log squid
#cache_access_log /data0/squidlogs/access.log combined
cache_log /usr/local/squid3.1/squidlogs/squid.log
cache_store_log none
logfile_rotate 20
emulate_httpd_log on
cache_effective_user squid
cache_effective_group squid
pid_filename /data0/squidlogs/squid.pid
hosts_file /usr/local/squid3.1/etc/hosts.squid
mime_table /usr/local/squid3.1/etc/mime.conf
diskd_program /usr/local/squid3.1/libexec/diskd-daemon
unlinkd_program /usr/local/squid3.1/libexec/unlinkd
icon_directory /usr/local/squid3.1/share/icons
#error_directory /usr/local/squid3.1/etc/squid/errors/Simplify_Chinese
#Recommended minimum configuration:
#acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl Safe_ports port 80          # http
acl Safe_ports port 8080        # http
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT

#
acl LanDstDM dstdomain .feiyang.cc
acl PURGE method PURGE
acl CONNECT method CONNECT
acl inside src 192.168.1.0/24
acl allowed_ports port 80
acl allowed_ports port 8080
acl has_referer  referer_regex -i .
acl has_botagent browser -i googlebot
http_access allow !has_referer
http_access allow LanDstDM
http_access allow inside
http_access allow all
request_header_access All allow all

http_reply_access allow all
#duilie

acl PURGE method PURGE
http_access allow PURGE localhost
#http_access allow PURGE blog
http_access deny PURGE

#follow_x_forwarded_for allow all

#no_cache deny blog
no_cache deny localhost

#http_access allow manager blog
http_access allow manager localhost
acl monitor src 202.108.6.88
http_access allow manager monitor
http_access deny manager all


# http_access deny QUERY
http_access allow all
http_reply_access allow all
cachemgr_passwd none all
#icp_access allow blog_hosts
icp_access deny all
#reply_body_max_size 0 allow all

#always_direct allow allowed_doms
# always_direct allow all
##cache img
refresh_pattern ^ftp:       1440    20% 10080
refresh_pattern ^gopher:    1440    0%  1440
refresh_pattern .       0   20% 4320
#refresh_pattern -i \.css$       360    50%     2880    reload-into-ims
#refresh_pattern -i \.js$        1440    50%     2880    reload-into-ims
#refresh_pattern -i \.html$        720   50%     1440    reload-into-ims
#refresh_pattern -i \.jpg$       1440    90%     2880    ignore-reload
#refresh_pattern -i \.gif$       1440    90%     2880    ignore-reload
#refresh_pattern -i \.swf$       1440    90%     2880    ignore-reload
#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

#cache_peer
cache_peer test.feiyang.cc  parent 80 0 no-query originserver no-digest   name=test
#cache_peer 192.168.1.151 parent 80 0 no-query originserver no-digest
cache_peer_domain test test.feiyang.cc




请教squid3.1.x 对http11 支持如何进行设置!!

问题继续跟踪中,继续翻阅资料,并希望大家能提供一些建议。
 
进展1:修改源码
    我试着将src 下关于http协议的源码由http1.0 都改为http1.1 重新编译安装,效果一样。待续。。
阅读(1568) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~