<div>Hi, Maxim,<br><div><br><div><div>You are right. Connection is hop-by-hop header. At present I add the line below into nginx.conf:<br><br></div><div>proxy-set-headers Connection $http_connection<br><div><br><div>That solve my issue.<br><div><br><div>Thanks<br>Liu Peng<br></div></div></div></div></div></div></div></div><div id="origbody"><div style="background: #f2f2f2;">----- 原始邮件 -----<br>发件人:Maxim Dounin <mdounin@mdounin.ru><br>收件人:nginx@nginx.org<br>主题:Re: why "connection: close" header is added when the request is passed to upstream server?<br>日期:2017年01月19日 21点23分<br></div><br><br>Hello!<br>On Thu, Jan 19, 2017 at 09:02:34AM +0800, tjlp@sina.com wrote:<br>> I use Nginx in the Kubernetes. With the upstream server log, I <br>> find that the header "connection: close" is added when the <br>> request is passed to upstream server. Why?<br>Because the connection between nginx and the upstream server is a <br>separate connection, and by default nginx isn't going to keep it <br>alive.  Keepalive connections to upstream servers can be <br>configured as documented here:<br>http://nginx.org/r/keepalive<br>> What I hope is the original header relating to connection status <br>> should be passed to upstream server without any change. That <br>> means: if the original request header has no connection header, <br>> "connection" header should not be added. <br>The connection between nginx and the backend server is a <br>completely separate connection, and it is expected to have it's <br>own hop-by-hop headers, see RFC 2616 here:<br>https://tools.ietf.org/html/rfc2616#section-13.5.1<br>-- <br>Maxim Dounin<br>http://nginx.org/<br>_______________________________________________<br>nginx mailing list<br>nginx@nginx.org<br>http://mailman.nginx.org/mailman/listinfo/nginx<br></div>