KeepAlive and Connection closed

matt_l nginx-forum at
Tue Jul 8 19:42:55 UTC 2014

I am new to nginx. I will be taking the nginx training next week. In the
meantime I was wondering if i was implementing the following properly.
I have an nginx instance that is sitting between my server and a client. 
The client requires that I close the connection when I respond to it. 
The server requires that I keep the connection alive for performance
Between the server and nginx, I have set up the keepalive option.
upstream a-name {
        server XXX.XXX.XXX.XXX:12360;
        keepalive 1024;
Between the client and the nginx, I have set keepalive_requests to 1;
server {
        listen       12360;
        access_log /var/log/nginx/access-a-name-12360.log;
        keepalive_requests 1;

        location /auctions {
                limit_req       zone=one        burst=2100;
                limit_req_status 503;
                limit_conn_status 503;
                proxy_pass http://a-name;
                proxy_http_version 1.1;
                proxy_set_header Connection "";

        location / {
                return 403;

        error_page 503 = /empty;
        location /empty {
                return 204;
Am I doing the right thing? 
Or can I have nginx add "Connection: close\r\n" to the header when it sends
the response back to the client.
Thank you for your help

Posted at Nginx Forum:,251560,251560#msg-251560

More information about the nginx mailing list