keep-alive confused

Maxim Dounin mdounin at mdounin.ru
Fri Feb 13 13:01:39 UTC 2015


Hello!

On Fri, Feb 13, 2015 at 02:55:38PM +0800, kevin_wangxk at sina.cn wrote:

> 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?

http://nginx.org/r/keepalive

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list