From 4b5638002a16edca47990b5d883257c84d7ddedf Mon Sep 17 00:00:00 2001 From: Justin Wong <46082645+uvjustin@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:50:53 +0800 Subject: [PATCH] Update nginx location for cacheable images --- docker/rootfs/usr/local/nginx/conf/nginx.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/rootfs/usr/local/nginx/conf/nginx.conf b/docker/rootfs/usr/local/nginx/conf/nginx.conf index 7437f42fd..d1e13eb31 100644 --- a/docker/rootfs/usr/local/nginx/conf/nginx.conf +++ b/docker/rootfs/usr/local/nginx/conf/nginx.conf @@ -172,10 +172,11 @@ http { proxy_set_header Host $host; } - location ~* /api/(.*\.(jpg|jpeg|png)$) { + location ~* /api/.*\.(jpg|jpeg|png)$ { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS'; - proxy_pass http://frigate_api/$1$is_args$args; + rewrite ^/api/(.*)$ $1 break; + proxy_pass http://frigate_api; proxy_pass_request_headers on; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;