0

In official Nginx docs a new directive added since v1.19.10 named keepalive_time 1h: Nginx keepalive_time Doc

Limits the maximum time during which requests can be processed through one keep-alive connection. After this time is reached, the connection is closed following the subsequent request processing.

Once a keep-alive connection initiates by browser, keepalive_timeout 75s limits the time during witch the next static HTTP request could be sent. After 75s, the keep-alive connection will be terminated. Now my question is, what will be happened after keepalive_time 1h? The connection already closed after 75 seconds! Does this mean that Nginx can execute a request witch has sent in a keep-alive connection for 1 hour?

Please simply describe the differences with an example as much as possible.

  • 1
    Only an idle keep-alive connection is closed after 75s. If the connection remains active (i.e. the browser continues to make many requests) then it will be closed after 1h. – Richard Smith Jan 30 '23 at 10:55
  • @RichardSmith Did I understand correctly: Every keep-alive connection that receives a new request in less than 75 seconds frequently, will last up to one hour at max (by `keepalive_time 1h`). Of course, it is clear that if there is no request in 75 seconds, it will be closed by `keepalive_timeout 75s` – Mohamad Reza Jan 30 '23 at 16:44
  • That is my understanding from reading the documents. – Richard Smith Jan 30 '23 at 20:30

0 Answers0