免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5017 | 回复: 2

squid 3.1.8 如何支持http1.1 [复制链接]

论坛徽章:
0
发表于 2011-03-28 12:53 |显示全部楼层
之前用的是squid2.6,但是对http11 支持不好,虽然squid2.7 设置参数可以支持http11,但是这些都是部分的。
看了下squid版本之间的对比,说squid3.0.xx 以上对http11完美支持。
           我采用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.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


附上配置文件

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"  %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
#logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh %{host}>h
logformat combined %>a %ui %un [%tl] "%rm %ru  HTTP/%rv" %Hs %<st "%{Referer}>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 支持如何进行设置!!

论坛徽章:
0
发表于 2011-04-12 10:10 |显示全部楼层
顶一个,别让此贴沉底了!!!!!

论坛徽章:
0
发表于 2012-06-30 08:51 |显示全部楼层
继续,我也想知道
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP