1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/peertube_ynh.git synced 2024-09-03 19:56:29 +02:00

Update to nginx upstream version

This commit is contained in:
yalh76 2020-06-02 14:57:05 +02:00
parent 703489347d
commit a78b0316bd

View file

@ -1,7 +1,7 @@
more_set_headers "X-Frame-Options : ALLOWALL"; more_set_headers "X-Frame-Options : ALLOWALL";
# Bypass PeerTube for performance reasons. Could be removed # Bypass PeerTube for performance reasons. Could be removed
location ~ ^/client/(.*\.(js|css|woff2|otf|ttf|woff|eot))$ { location ~ ^/client/(.*\.(js|css|png|svg|woff2|otf|ttf|woff|eot))$ {
add_header Cache-Control "public, max-age=31536000, immutable"; add_header Cache-Control "public, max-age=31536000, immutable";
alias __FINALPATH__/client/dist/$1; alias __FINALPATH__/client/dist/$1;
@ -52,6 +52,7 @@ location / {
# on a dedicated filesystem. # on a dedicated filesystem.
# #
client_max_body_size 8G; client_max_body_size 8G;
proxy_connect_timeout 600; proxy_connect_timeout 600;
proxy_send_timeout 600; proxy_send_timeout 600;
proxy_read_timeout 600; proxy_read_timeout 600;
@ -62,9 +63,20 @@ location / {
} }
# Bypass PeerTube for performance reasons. Could be removed # Bypass PeerTube for performance reasons. Could be removed
location ~ ^/static/(webseed|redundancy)/ { location ~ ^/static/(webseed|redundancy|streaming-playlists)/ {
# Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client # 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;
}
# Use this with nginx >= 1.17.0
# limit_rate $peertube_limit_rate;
# Or this if your nginx < 1.17.0
set $limit_rate $peertube_limit_rate;
limit_rate_after 5000k;
if ($request_method = 'OPTIONS') { if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Origin' '*';
@ -89,6 +101,7 @@ location ~ ^/static/(webseed|redundancy)/ {
rewrite ^/static/webseed/(.*)$ /videos/$1 break; rewrite ^/static/webseed/(.*)$ /videos/$1 break;
rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break; rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break;
rewrite ^/static/streaming-playlists/(.*)$ /streaming-playlists/$1 break;
try_files $uri /; try_files $uri /;
} }