From c02a3c975ad10311d1b02707a42a6909bf4cd8f1 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 22 Oct 2026 16:20:50 -0500 Subject: [PATCH] reuse pooled upstream connections for nginx auth subrequests The /auth subrequest proxied to a variable address, which nginx can't pool, and its location-level headers dropped the inherited Connection header so nginx sent Connection: close. Every authenticated request opened and closed its own loopback connection to the API. It now proxies to the frigate_api upstream with an empty Connection header so the keepalive pool is reused. --- docker/main/rootfs/usr/local/nginx/conf/auth_location.conf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker/main/rootfs/usr/local/nginx/conf/auth_location.conf b/docker/main/rootfs/usr/local/nginx/conf/auth_location.conf index 2ff7bf9d9f..6f27ea7e2d 100644 --- a/docker/main/rootfs/usr/local/nginx/conf/auth_location.conf +++ b/docker/main/rootfs/usr/local/nginx/conf/auth_location.conf @@ -1,10 +1,8 @@ -set $upstream_auth http://127.0.0.1:5001/auth; - ## Virtual endpoint created by nginx to forward auth requests. location /auth { ## Essential Proxy Configuration internal; - proxy_pass $upstream_auth; + proxy_pass http://frigate_api/auth; ## Headers @@ -39,6 +37,7 @@ location /auth { proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; # Timeout if the real server is dead proxy_redirect http:// $scheme://; proxy_http_version 1.1; + proxy_set_header Connection ""; proxy_cache_bypass $cookie_session; proxy_no_cache $cookie_session; proxy_buffers 4 32k;