From bdc65ad6a4ff199bcbdd66f9cbb883a5c8777972 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Tue, 30 Aug 2022 09:09:32 +0200 Subject: [PATCH 1/2] Update ffplayout.conf --- assets/ffplayout.conf | 44 +++---------------------------------------- 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/assets/ffplayout.conf b/assets/ffplayout.conf index 90d2c12c..3cbea865 100644 --- a/assets/ffplayout.conf +++ b/assets/ffplayout.conf @@ -17,59 +17,21 @@ server { add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; location / { - if ($http_origin ~ '^https?://(localhost|ffplayout\.local)') { - add_header 'Access-Control-Allow-Origin' "$http_origin" always; - add_header 'Access-Control-Allow-Credentials' 'true' always; - add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always; - } - - if ($request_method = OPTIONS ) { - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; - return 204; - } - - root /var/www/ffplayout-frontend/; - } - - location ~ ^/(api|auth) { - if ($http_origin ~ '^https?://(localhost|ffplayout\.local)') { - add_header 'Access-Control-Allow-Origin' "$http_origin" always; - add_header 'Access-Control-Allow-Credentials' 'true' always; - add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always; - } - - add_header Last-Modified $date_gmt; - add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; - if_modified_since off; - expires off; - etag off; - proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 36000s; - proxy_connect_timeout 36000s; + proxy_connect_timeout 36000s; proxy_send_timeout 36000s; proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; send_timeout 36000s; - proxy_no_cache 1; - proxy_pass http://127.0.0.1:8000; - + proxy_pass http://127.0.0.1:8787; } location /live/ { - alias /var/www/srs/live/; - } - - location /preview/stream.flv { - # HTTP-FLV preview - proxy_pass http://preview.local:8080/live/stream.flv; + alias /usr/share/ffplayout/public/live/; } } From d5864d03af53b244568a57a5f7964f82b5f3e562 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Tue, 30 Aug 2022 11:51:04 +0200 Subject: [PATCH 2/2] Update preview_stream.md --- docs/preview_stream.md | 46 ++++-------------------------------------- 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/docs/preview_stream.md b/docs/preview_stream.md index d06459fd..80436bb5 100644 --- a/docs/preview_stream.md +++ b/docs/preview_stream.md @@ -147,59 +147,21 @@ server { add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; location / { - if ($http_origin ~ '^https?://(localhost|ffplayout\.example\.org)') { - add_header 'Access-Control-Allow-Origin' "$http_origin" always; - add_header 'Access-Control-Allow-Credentials' 'true' always; - add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always; - } - - if ($request_method = OPTIONS ) { - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; - return 204; - } - - root /var/www/ffplayout-frontend/dist/; - - } - - location ~ ^/(api|admin|auth|api-auth) { - if ($http_origin ~ '^https?://(localhost|ffplayout\.local)') { - add_header 'Access-Control-Allow-Origin' "$http_origin" always; - add_header 'Access-Control-Allow-Credentials' 'true' always; - add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always; - } - - add_header Last-Modified $date_gmt; - add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; - if_modified_since off; - expires off; - etag off; - proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 36000s; - proxy_connect_timeout 36000s; + proxy_connect_timeout 36000s; proxy_send_timeout 36000s; proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; send_timeout 36000s; - proxy_no_cache 1; - proxy_pass http://127.0.0.1:8001; - + proxy_pass http://127.0.0.1:8787; } - - location /static/ { - alias /var/www/ffplayout-api/ffplayout/static/; - } - - location /live/ { + + location /live/ { alias /var/www/srs/live/; }