diff options
author | Chocobozzz <me@florianbigard.com> | 2019-12-10 12:11:20 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-12-10 12:11:20 +0100 |
commit | f37db8966d60403c7483d4597007830ee3d05ca9 (patch) | |
tree | 386fc9122efc29d0c0a4a06cfa9e956a20741b74 /support/nginx/peertube | |
parent | fc641dedd6d984bf49d6b2c20ace4d5ecf25e06f (diff) | |
download | PeerTube-f37db8966d60403c7483d4597007830ee3d05ca9.tar.gz PeerTube-f37db8966d60403c7483d4597007830ee3d05ca9.tar.zst PeerTube-f37db8966d60403c7483d4597007830ee3d05ca9.zip |
Add streaming playlists endpoint in nginx
Diffstat (limited to 'support/nginx/peertube')
-rw-r--r-- | support/nginx/peertube | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/support/nginx/peertube b/support/nginx/peertube index 05f172280..a1cdc2221 100644 --- a/support/nginx/peertube +++ b/support/nginx/peertube | |||
@@ -119,9 +119,7 @@ server { | |||
119 | } | 119 | } |
120 | 120 | ||
121 | # Bypass PeerTube for performance reasons. Could be removed | 121 | # Bypass PeerTube for performance reasons. Could be removed |
122 | location ~ ^/static/(webseed|redundancy)/ { | 122 | location ~ ^/static/(webseed|redundancy|streaming-playlists)/ { |
123 | # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client | ||
124 | limit_rate 800k; | ||
125 | 123 | ||
126 | if ($request_method = 'OPTIONS') { | 124 | if ($request_method = 'OPTIONS') { |
127 | add_header 'Access-Control-Allow-Origin' '*'; | 125 | add_header 'Access-Control-Allow-Origin' '*'; |
@@ -142,10 +140,25 @@ server { | |||
142 | access_log off; | 140 | access_log off; |
143 | } | 141 | } |
144 | 142 | ||
143 | # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client | ||
144 | set $peertube_limit_rate 800k; | ||
145 | |||
146 | # Increase rate limit in HLS mode, because we don't have multiple simultaneous connections | ||
147 | if ($request_uri ~ -fragmented.mp4$) { | ||
148 | set $peertube_limit_rate 5000k; | ||
149 | } | ||
150 | |||
151 | # Use this with nginx >= 1.17.0 | ||
152 | # limit_rate $peertube_limit_rate; | ||
153 | # Or this if your nginx < 1.17.0 | ||
154 | set $limit_rate $peertube_limit_rate; | ||
155 | limit_rate_after 5000k; | ||
156 | |||
145 | root /var/www/peertube/storage; | 157 | root /var/www/peertube/storage; |
146 | 158 | ||
147 | rewrite ^/static/webseed/(.*)$ /videos/$1 break; | 159 | rewrite ^/static/webseed/(.*)$ /videos/$1 break; |
148 | rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break; | 160 | rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break; |
161 | rewrite ^/static/streaming-playlists/(.*)$ /streaming-playlists/$1 break; | ||
149 | 162 | ||
150 | try_files $uri /; | 163 | try_files $uri /; |
151 | } | 164 | } |