Explorar el Código

update nginx config

Blake Blackshear hace 4 años
padre
commit
59daa6597b
Se han modificado 1 ficheros con 14 adiciones y 5 borrados
  1. 14 5
      nginx/nginx.conf

+ 14 - 5
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;
         }
     }
 }