From cf0f8892e21498f54e60eaa260d3cd3ea6771cd2 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sun, 8 Nov 2020 16:35:21 -0600 Subject: [PATCH] update nginx config --- nginx/nginx.conf | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 19cc18fc2..54f5d2132 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -18,12 +18,13 @@ http { access_log /var/log/nginx/access.log main; sendfile on; - client_max_body_size 50M; - #tcp_nopush on; keepalive_timeout 65; - #gzip on; + upstream frigate_api { + server localhost:5000; + keepalive 1024; + } server { listen 80; @@ -51,7 +52,7 @@ http { root /tmp; } - location /frigate/ { + location /clips/ { add_header 'Access-Control-Allow-Origin' "$http_origin" always; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Expose-Headers' 'Content-Length'; @@ -69,7 +70,15 @@ http { } autoindex on; - root /media; + root /media/frigate; + } + + location / { + 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; + proxy_set_header X-Forwarded-Proto $scheme; } } } \ No newline at end of file