From d0227a3d80a1828928802c9b37eacd59405a3d2d Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Tue, 7 Nov 2023 12:52:26 -0700 Subject: [PATCH] Use map instead --- docker/main/rootfs/usr/local/nginx/conf/nginx.conf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docker/main/rootfs/usr/local/nginx/conf/nginx.conf b/docker/main/rootfs/usr/local/nginx/conf/nginx.conf index d2bc8cfdb..925168463 100644 --- a/docker/main/rootfs/usr/local/nginx/conf/nginx.conf +++ b/docker/main/rootfs/usr/local/nginx/conf/nginx.conf @@ -34,6 +34,11 @@ http { proxy_cache_path /dev/shm/nginx_cache levels=1:2 keys_zone=api_cache:10m max_size=10m inactive=1m use_temp_path=off; + map $http_accept $should_not_cache { + 'application/json' 0; + default 1; + } + upstream frigate_api { server 127.0.0.1:5001; keepalive 1024; @@ -192,12 +197,9 @@ http { proxy_cache_use_stale updating; proxy_cache_valid 200 5s; proxy_cache_bypass $http_x_cache_bypass; + proxy_no_cache $should_not_cache; add_header X-Cache-Status $upstream_cache_status; - if ($http_accept !~ "application/json") { - proxy_no_cache 1; - } - location /api/vod/ { proxy_pass http://frigate_api/vod/; include proxy.conf;