Welcome! Log In Create A New Profile

Advanced

keep-alive confused

Anonymous User
February 13, 2015 01:56AM
hello,

I use nginx as a reverse proxy, and I find a question that confused me.

In upstream loction I use keepalive direction to keep a connection pool. As everyone knows,
that can reduse tcp handshake cost. When I send request with "Connection: keep-alive" header
using http /1.0 protocal to nginx, I find nginx transmits the request to backend with "Connection: close"
header. You know, "Connection: close" header will lead backend close the connection, and keepalive
direction cannt work.

for example below:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
GET /2/proxyauth/auth.json?source=84883&&access_token=2.00JGc2QCCPl5PDe1e566dDfAD&object_id=1022:100101B2094650D064A0F5469D&uid=1042:2673106753&auth_type=option HTTP/1.0
Connection: keep-alive
Client-Uri: /2/proxy/darwin/movie/mblog_list.json?source=848343583&&access_token=2.00JGc2QCCPl5PDe1e566d3b9NzDfAD&object_id=1022:100101B2094650D064A0F5469D&uid=1042:2673106753
Client-Host: localhost
Host: oauthweibo
User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
Accept: */*


HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Fri, 13 Feb 2015 06:47:39 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Api-Server-IP: 10.75.25.127
Vary: Accept-Encoding
/////////////////////////////////////////////////////////////////////////////////////

Anybody meet that problem? Ideas anyone? thanks very much.

When nginx transmits requests to backend, it uses http /1.0 protocal. Why is that?

Thanks.

------------------

Regards!
xiaokai
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

keep-alive confused

Anonymous User February 13, 2015 01:56AM

Re: keep-alive confused

Maxim Dounin February 13, 2015 08:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 76
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