add jsmpeg relay

This commit is contained in:
Blake Blackshear
2021-06-12 07:23:14 -05:00
parent c71b717a54
commit 7309c06be8
6 changed files with 106 additions and 0 deletions
+13
View File
@@ -32,6 +32,11 @@ http {
keepalive 1024;
}
upstream jsmpeg {
server localhost:8082;
keepalive 1024;
}
server {
listen 5000;
@@ -140,6 +145,14 @@ http {
proxy_set_header Host $host;
}
location /live/ {
proxy_pass http://jsmpeg/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
location /api/ {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';