From 7c5d26ecd68bedf330a571e6741ade4df29a8d91 Mon Sep 17 00:00:00 2001 From: nutomic Date: Fri, 12 Feb 2021 17:12:31 +0000 Subject: [PATCH] Remove part of nginx config which causes problems with live streaming --- templates/nginx.conf.j2 | 50 ----------------------------------------- 1 file changed, 50 deletions(-) diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index a788284..d46517d 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -95,56 +95,6 @@ ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECD add_header Cache-Control "public, max-age=31536000, immutable"; } } - location ~ ^/static/(webseed|redundancy|streaming-playlists)/ { - # NOTE: Its not possible to use proxy_cache for files that are served from disk without complicated workarounds - # Anyway caching is not a great idea because files are changed on disk after transcoding. - #slice 1m; - #proxy_cache peertube_video_cache; - #proxy_cache_valid 206 1h; - #proxy_cache_key $uri$is_args$args$slice_range; - #proxy_set_header Range $slice_range; - #proxy_http_version 1.1; - #proxy_pass http://peertube:9000; - # required workaround for https://github.com/Chocobozzz/PeerTube/issues/1777 - #proxy_ignore_headers Cache-Control; - # for debugging - #add_header X-Cache-Status $upstream_cache_status; - - # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client - set $peertube_limit_rate 800k; - - # Increase rate limit in HLS mode, because we don't have multiple simultaneous connections - if ($request_uri ~ -fragmented.mp4$) { - set $peertube_limit_rate 5000k; - } - - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; - return 204; - } - - if ($request_method = 'GET') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; - - # Don't spam access log file with byte range requests - access_log off; - } - - root /data-external; - - rewrite ^/static/webseed/(.*)$ /videos/$1 break; - rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break; - rewrite ^/static/streaming-playlists/(.*)$ /streaming-playlists/$1 break; - - try_files $uri /; - } # Websocket tracker location /tracker/socket { # Peers send a message to the tracker every 15 minutes