1
0
mirror of https://yerbamate.ml/nutomic/peertube.social synced 2024-11-25 01:18:20 -05:00

Remove part of nginx config which causes problems with live streaming

This commit is contained in:
nutomic 2021-02-12 17:12:31 +00:00
parent 9be6d0e9f5
commit 7c5d26ecd6

View File

@ -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"; 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 # Websocket tracker
location /tracker/socket { location /tracker/socket {
# Peers send a message to the tracker every 15 minutes # Peers send a message to the tracker every 15 minutes