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.
This commit is contained in:
Josh Hawkins
2026-10-22 16:54:46 -05:00
parent d30772645d
commit 15c7f435ee
+2
View File
@@ -731,6 +731,8 @@ class FrigateApp:
host="127.0.0.1", host="127.0.0.1",
port=5001, port=5001,
log_level="error", log_level="error",
# outlive nginx's 60s upstream keepalive so nginx closes idle connections first
timeout_keep_alive=75,
) )
finally: finally:
self.stop() self.stop()