Use map instead

This commit is contained in:
Nick Mowen 2023-11-07 12:52:26 -07:00
parent b78a3b975f
commit d0227a3d80

View File

@ -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;