<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi All,<br>
<br>
I am struggling to get keepalives to work on Nginx, I believe I have
added the necessary configuration. Can you take a look and suggest
where I may be going wrong or what I am missing?<br>
<br>
We have a nginx server that sits in front of a varnish server which
sits in front of the back-end servers<br>
<br>
http {<br>
<br>
keepalive_timeout 120;<br>
keepalive_requests 500;<br>
<br>
upstream varnish_rand {<br>
server 172.21.1.1:80;<br>
keepalive 256;<br>
}<br>
<br>
server {<br>
server_name <a class="moz-txt-link-abbreviated" href="http://www.abc.com">www.abc.com</a><br>
<br>
location / {<br>
<br>
proxy_pass <a class="moz-txt-link-freetext" href="http://varnish_rand">http://varnish_rand</a>;<br>
proxy_http_version 1.1;<br>
<br>
}<br>
}<br>
<br>
You can see that the nginx server is using HTTP1.1 to communicate
with Varnish<br>
<br>
<b>varnishtop -i RxProtocol </b><br>
list length 1<br>
<br>
9.67 RxProtocol HTTP/1.1<br>
<br>
However there nginx always send a "connection close"<br>
<br>
<b>varnishtop -c -i RxHeader -I "Connection"</b><br>
<br>
list length 1<br>
<br>
9.59 RxHeader Connection: close<br>
<br>
<br>
Thanks in advance<br>
<br>
Nick<br>
<br>
<br>
</body>
</html>