From 22c8828da812c651fdb2b5b9c19729269b79bd15 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Thu, 13 Oct 2022 16:43:29 -0600 Subject: [PATCH] Add restream to nginx --- docker/rootfs/usr/local/nginx/conf/nginx.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docker/rootfs/usr/local/nginx/conf/nginx.conf b/docker/rootfs/usr/local/nginx/conf/nginx.conf index 881bbefdb..687b55bee 100644 --- a/docker/rootfs/usr/local/nginx/conf/nginx.conf +++ b/docker/rootfs/usr/local/nginx/conf/nginx.conf @@ -44,6 +44,11 @@ http { keepalive 1024; } + upstream go2rtc_api { + server 127.0.0.1:1984; + keepalive 1024; + } + server { listen 5000; @@ -173,6 +178,14 @@ http { proxy_set_header Host $host; } + location /restream/ { + proxy_pass http://go2rtc_api/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; + } + location ~* /api/.*\.(jpg|jpeg|png)$ { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';