aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/nginx/peertube
diff options
context:
space:
mode:
Diffstat (limited to 'support/nginx/peertube')
-rw-r--r--support/nginx/peertube12
1 files changed, 3 insertions, 9 deletions
diff --git a/support/nginx/peertube b/support/nginx/peertube
index f5b9d131a..822f6f9ac 100644
--- a/support/nginx/peertube
+++ b/support/nginx/peertube
@@ -199,7 +199,7 @@ server {
199 alias /var/www/peertube/peertube-latest/client/dist/$1; 199 alias /var/www/peertube/peertube-latest/client/dist/$1;
200 } 200 }
201 201
202 location ~ ^(/static/(webseed|streaming-playlists)/private/)|^/download { 202 location ~ ^(/static/(webseed|web-videos|streaming-playlists)/private/)|^/download {
203 # We can't rate limit a try_files directive, so we need to duplicate @api 203 # We can't rate limit a try_files directive, so we need to duplicate @api
204 204
205 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 205 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -212,16 +212,10 @@ server {
212 } 212 }
213 213
214 # Bypass PeerTube for performance reasons. Optional. 214 # Bypass PeerTube for performance reasons. Optional.
215 location ~ ^/static/(webseed|redundancy|streaming-playlists)/ { 215 location ~ ^/static/(webseed|web-videos|redundancy|streaming-playlists)/ {
216 limit_rate_after 5M; 216 limit_rate_after 5M;
217 217
218 # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client 218 set $peertube_limit_rate 5M;
219 set $peertube_limit_rate 800k;
220
221 # Increase rate limit in HLS mode, because we don't have multiple simultaneous connections
222 if ($request_uri ~ -fragmented.mp4$) {
223 set $peertube_limit_rate 5M;
224 }
225 219
226 # Use this line with nginx >= 1.17.0 220 # Use this line with nginx >= 1.17.0
227 limit_rate $peertube_limit_rate; 221 limit_rate $peertube_limit_rate;