From 15c7f435ee0126e0db3155fdd4cacefe0d498999 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 22 Oct 2026 15:36:09 -0500 Subject: [PATCH] keep uvicorn idle connections open longer than nginx's upstream keepalive uvicorn closed idle connections after its 5s default while nginx kept them pooled for 60s, so a request nginx sent on a connection uvicorn was closing got a 502. nginx retries that on a fresh connection for most methods, but not for POST or PATCH. --- frigate/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frigate/app.py b/frigate/app.py index fe7f1e237c..7c7b152696 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -731,6 +731,8 @@ class FrigateApp: host="127.0.0.1", port=5001, log_level="error", + # outlive nginx's 60s upstream keepalive so nginx closes idle connections first + timeout_keep_alive=75, ) finally: self.stop()