Add dir to nginx

This commit is contained in:
Nick Mowen 2023-05-20 09:18:37 -06:00
parent 3649dd3d59
commit 9c32404e91
2 changed files with 21 additions and 2 deletions

View File

@ -172,6 +172,27 @@ http {
root /media/frigate; root /media/frigate;
} }
location /exports/ {
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Expose-Headers' 'Content-Length';
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
types {
video/mp4 mp4;
}
autoindex on;
autoindex_format json;
root /media/frigate;
}
location /ws { location /ws {
proxy_pass http://mqtt_ws/; proxy_pass http://mqtt_ws/;
proxy_http_version 1.1; proxy_http_version 1.1;

View File

@ -88,8 +88,6 @@ class RecordingExporter(threading.Thread):
p = sp.run( p = sp.run(
ffmpeg_cmd, ffmpeg_cmd,
input="\n".join(playlist_lines) input="\n".join(playlist_lines)
if len(playlist_lines) > 1
else playlist_lines,
encoding="ascii", encoding="ascii",
capture_output=True, capture_output=True,
) )