From 4994fd4baebaf8ae2d509be1b41c86867142b95b Mon Sep 17 00:00:00 2001 From: Lukas Schulz Date: Sat, 25 Jul 2020 16:44:40 +0200 Subject: [PATCH] Add new file --- node.conf | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 node.conf diff --git a/node.conf b/node.conf new file mode 100644 index 0000000..d66cae9 --- /dev/null +++ b/node.conf @@ -0,0 +1,65 @@ +user www-data; +worker_processes auto; +pid /run/nginx.pid; +include /etc/nginx/modules-enabled/*.conf; + +events { + worker_connections 768; + # multi_accept on; +} + + +http { +proxy_cache_path /var/cache/hls keys_zone=hls:10m max_size=10g + inactive=60m use_temp_path=off; +proxy_cache_path /var/cache/dash levels=1:2 keys_zone=dash:10m max_size=10g + inactive=60m use_temp_path=off; + server { + + listen 8080; + listen [::]:8080; + # This URL provides RTMP statistics in XML + location /stat { + proxy_pass http://streaming-server.tld/stat; + + # Use this stylesheet to view XML as web page + # in browser + #rtmp_stat_stylesheet stat.xsl; + } + + location /stat.xsl { + # XML stylesheet to view RTMP stats. + # Copy stat.xsl wherever you want + # and put the full directory path here + proxy_pass http://streaming-server.tld/stat.xsl; + } + + location ~* \.(m3u8)$ { + proxy_cache off; # Do not activate proxy cache (i.e m3u8,f4m,... playlist files) + expires -1; # Cache-Control: no-cache + proxy_pass http://streaming-server.tld$request_uri; + } + + location /hls { + # Serve HLS fragments + types { + application/vnd.apple.mpegurl m3u8; + video/mp2t ts; + } + proxy_cache hls; + proxy_ignore_headers Cache-Control; + proxy_cache_valid any 30m; + proxy_pass http://streaming-server.tld$request_uri; + #add_header Cache-Control no-cache; + } + + location /dash { + # Serve DASH fragments + proxy_cache dash; + proxy_ignore_headers Cache-Control; + proxy_cache_valid any 30m; + proxy_pass http://streming-server.tld$request_uri; + add_header Cache-Control no-cache; + } + } +} \ No newline at end of file