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; diff --git a/frigate/http.py b/frigate/http.py index b7ed51783..84a8c855e 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -8,6 +8,7 @@ import subprocess as sp import time from functools import reduce from pathlib import Path +from urllib.parse import unquote import cv2 @@ -341,6 +342,7 @@ def event_thumbnail(id, max_cache_age=2592000): @bp.route("//