Welcome! Log In Create A New Profile

Advanced

Re: KeepAlive and Connection closed

Maxim Dounin
July 08, 2014 05:54PM
Hello!

On Tue, Jul 08, 2014 at 03:42:55PM -0400, matt_l wrote:

> Hello
> 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
> reason.
> Between the server and nginx, I have set up the keepalive option.
> Example:
> upstream a-name {
> server XXX.XXX.XXX.XXX:12360;
> keepalive 1024;
> }
> Between the client and the nginx, I have set keepalive_requests to 1;
> Example:
> server {
> listen 12360;
> access_log /var/log/nginx/access-a-name-12360.log;
> keepalive_requests 1;

Recommended way to disable keepalive connections is to use,
keepalive_timeout with the zero value:

keepalive_timeout 0;

See http://nginx.org/r/keepalive_timeout.

Though "keepalive_requests 1" should work too.

[...]

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

The "Connection: close" header will be automatically added to the
response if keepalive is disabled.

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

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

KeepAlive and Connection closed

matt_l July 08, 2014 03:42PM

Re: KeepAlive and Connection closed

Maxim Dounin July 08, 2014 05:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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