How to make nginx establish persistent connections with squid?

selphon nginx-forum at nginx.us
Sun Mar 24 08:42:36 UTC 2013


Hi, Maxim Dounin

I revise the  topology:
chrome --> squid:80 --> origin server(nginx :80)

and make 5 requests,the squid log shows:

192.168.70.160 - - [22/Mar/2013:15:41:41 +0800] "GET
http://test.cache.com/p3.jpg?tt=2013032201 HTTP/1.1" 304 365
"http://test.cache.com/p3.jpg?tt=2013032201" "Mozilla/5.0 (Windows NT 6.1)
AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22"
TCP_REFRESH_HIT:DIRECT/192.168.13.210      0

"Host: test.cache.com  #request header
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.22 (KHTML, like
Gecko) Chrome/25.0.1364.172 Safari/537.22
Referer: http://test.cache.com/p3.jpg?tt=2013032201
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8
Accept-Charset: GBK,utf-8;q=0.7,*;q=0.3
If-Modified-Since: Tue, 23 Oct 2012 04:07:19 GMT"

"HTTP/1.0 304 Not Modified  #response header
Server: nginx/1.2.6
Date: Fri, 22 Mar 2013 07:41:41 GMT
Last-Modified: Tue, 23 Oct 2012 04:07:19 GMT
Expires: Fri, 22 Mar 2013 09:41:41 GMT
Cache-Control: max-age=7200
X-Cache: MISS from vm-linux1.test.com
X-Cache-Lookup: HIT from vm-linux1.test.com:80
Via: 1.1 vm-linux1.test.com:80 (squid/2.7.STABLE9)
Connection: keep-alive"

Though the response is in HTTP/1.0, the persistent connections is
successfully established  between chrome and squid. I wonder, is there a
restriction that nginx can only make establish persistent connections when
the response is in HTTP/1.1 protocol ?
Thx for answering.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,237666,237714#msg-237714



More information about the nginx mailing list