diff --git a/templates/docker-compose.yml b/templates/docker-compose.yml index e99e657..abdad7c 100644 --- a/templates/docker-compose.yml +++ b/templates/docker-compose.yml @@ -17,7 +17,7 @@ services: restart: "always" peertube: - image: chocobozzz/peertube:v2.0.0-stretch + image: chocobozzz/peertube:v2.1.0-buster env_file: - .env volumes: diff --git a/templates/nginx.conf b/templates/nginx.conf index c472065..a371351 100644 --- a/templates/nginx.conf +++ b/templates/nginx.conf @@ -95,7 +95,7 @@ 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)/ { + 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; @@ -111,7 +111,12 @@ ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECD #add_header X-Cache-Status $upstream_cache_status; # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client - limit_rate 800k; + 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' '*'; @@ -136,6 +141,7 @@ ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECD rewrite ^/static/webseed/(.*)$ /videos/$1 break; rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break; + rewrite ^/static/streaming-playlists/(.*)$ /streaming-playlists/$1 break; try_files $uri /; }