Welcome! Log In Create A New Profile

Advanced

回复:Re: why "connection: close" header is added when the request is passed to upstream server?

Anonymous User
January 19, 2017 08:02PM
Hi, Maxim,

You are right. Connection is hop-by-hop header. At present I add the line below into nginx.conf:

proxy-set-headers Connection $http_connection

That solve my issue.

Thanks
Liu Peng
----- 原始邮件 -----
发件人:Maxim Dounin <mdounin@mdounin.ru>
收件人:nginx@nginx.org
主题:Re: why "connection: close" header is added when the request is passed to upstream server?
日期:2017年01月19日 21点23分


Hello!
On Thu, Jan 19, 2017 at 09:02:34AM +0800, tjlp@sina.com wrote:
> I use Nginx in the Kubernetes. With the upstream server log, I
> find that the header "connection: close" is added when the
> request is passed to upstream server. Why?
Because the connection between nginx and the upstream server is a
separate connection, and by default nginx isn't going to keep it
alive. Keepalive connections to upstream servers can be
configured as documented here:
http://nginx.org/r/keepalive
> What I hope is the original header relating to connection status
> should be passed to upstream server without any change. That
> means: if the original request header has no connection header,
> "connection" header should not be added.
The connection between nginx and the backend server is a
completely separate connection, and it is expected to have it's
own hop-by-hop headers, see RFC 2616 here:
https://tools.ietf.org/html/rfc2616#section-13.5.1
--
Maxim Dounin
http://nginx.org/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

why "connection: close" header is added when the request is passed to upstream server?

Anonymous User January 18, 2017 08:04PM

Re: why "connection: close" header is added when the request is passed to upstream server?

Maxim Dounin January 19, 2017 08:34AM

回复:Re: why "connection: close" header is added when the request is passed to upstream server?

Anonymous User January 19, 2017 08:02PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 166
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready