nixos/peertube: update nginx configuration
This commit is contained in:
parent
b0b1f73473
commit
937220442c
|
@ -61,14 +61,16 @@ let
|
||||||
eval -- "\$@"
|
eval -- "\$@"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nginxCommonHeaders = lib.optionalString cfg.enableWebHttps ''
|
nginxCommonHeaders = lib.optionalString config.services.nginx.virtualHosts.${cfg.localDomain}.forceSSL ''
|
||||||
add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains';
|
add_header Strict-Transport-Security 'max-age=31536000';
|
||||||
'' + lib.optionalString config.services.nginx.virtualHosts.${cfg.localDomain}.http3 ''
|
'' + lib.optionalString (config.services.nginx.virtualHosts.${cfg.localDomain}.quic && config.services.nginx.virtualHosts.${cfg.localDomain}.http3) ''
|
||||||
add_header Alt-Svc 'h3=":443"; ma=86400';
|
add_header Alt-Svc 'h3=":$server_port"; ma=604800';
|
||||||
'' + ''
|
'';
|
||||||
add_header Access-Control-Allow-Origin '*';
|
|
||||||
add_header Access-Control-Allow-Methods 'GET, OPTIONS';
|
nginxCommonHeadersExtra = ''
|
||||||
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-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';
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
@ -487,6 +489,9 @@ in {
|
||||||
|
|
||||||
services.nginx = lib.mkIf cfg.configureNginx {
|
services.nginx = lib.mkIf cfg.configureNginx {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
upstreams."peertube".servers = {
|
||||||
|
"127.0.0.1:${toString cfg.listenHttp}".fail_timeout = "0";
|
||||||
|
};
|
||||||
virtualHosts."${cfg.localDomain}" = {
|
virtualHosts."${cfg.localDomain}" = {
|
||||||
root = "/var/lib/peertube/www";
|
root = "/var/lib/peertube/www";
|
||||||
|
|
||||||
|
@ -496,14 +501,14 @@ in {
|
||||||
priority = 1110;
|
priority = 1110;
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."= /api/v1/videos/upload-resumable" = {
|
locations."~ ^/api/v1/videos/(upload-resumable|([^/]+/source/replace-resumable))$" = {
|
||||||
tryFiles = "/dev/null @api";
|
tryFiles = "/dev/null @api";
|
||||||
priority = 1120;
|
priority = 1120;
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
client_max_body_size 0;
|
client_max_body_size 0;
|
||||||
proxy_request_buffering off;
|
proxy_request_buffering off;
|
||||||
'';
|
'' + nginxCommonHeaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."~ ^/api/v1/videos/(upload|([^/]+/studio/edit))$" = {
|
locations."~ ^/api/v1/videos/(upload|([^/]+/studio/edit))$" = {
|
||||||
|
@ -512,13 +517,11 @@ in {
|
||||||
priority = 1130;
|
priority = 1130;
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
client_max_body_size 12G;
|
limit_except POST HEAD { deny all; }
|
||||||
add_header X-File-Maximum-Size 8G always;
|
|
||||||
'' + lib.optionalString cfg.enableWebHttps ''
|
client_max_body_size 12G;
|
||||||
add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains';
|
add_header X-File-Maximum-Size 8G always;
|
||||||
'' + lib.optionalString config.services.nginx.virtualHosts.${cfg.localDomain}.http3 ''
|
'' + nginxCommonHeaders;
|
||||||
add_header Alt-Svc 'h3=":443"; ma=86400';
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."~ ^/api/v1/runners/jobs/[^/]+/(update|success)$" = {
|
locations."~ ^/api/v1/runners/jobs/[^/]+/(update|success)$" = {
|
||||||
|
@ -527,13 +530,9 @@ in {
|
||||||
priority = 1135;
|
priority = 1135;
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
client_max_body_size 12G;
|
client_max_body_size 12G;
|
||||||
add_header X-File-Maximum-Size 8G always;
|
add_header X-File-Maximum-Size 8G always;
|
||||||
'' + lib.optionalString cfg.enableWebHttps ''
|
'' + nginxCommonHeaders;
|
||||||
add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains';
|
|
||||||
'' + lib.optionalString config.services.nginx.virtualHosts.${cfg.localDomain}.http3 ''
|
|
||||||
add_header Alt-Svc 'h3=":443"; ma=86400';
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."~ ^/api/v1/(videos|video-playlists|video-channels|users/me)" = {
|
locations."~ ^/api/v1/(videos|video-playlists|video-channels|users/me)" = {
|
||||||
|
@ -541,32 +540,28 @@ in {
|
||||||
priority = 1140;
|
priority = 1140;
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
client_max_body_size 6M;
|
client_max_body_size 6M;
|
||||||
add_header X-File-Maximum-Size 4M always;
|
add_header X-File-Maximum-Size 4M always;
|
||||||
'' + lib.optionalString cfg.enableWebHttps ''
|
'' + nginxCommonHeaders;
|
||||||
add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains';
|
|
||||||
'' + lib.optionalString config.services.nginx.virtualHosts.${cfg.localDomain}.http3 ''
|
|
||||||
add_header Alt-Svc 'h3=":443"; ma=86400';
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."@api" = {
|
locations."@api" = {
|
||||||
proxyPass = "http://127.0.0.1:${toString cfg.listenHttp}";
|
proxyPass = "http://peertube";
|
||||||
priority = 1150;
|
priority = 1150;
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
proxy_connect_timeout 10m;
|
proxy_connect_timeout 10m;
|
||||||
|
|
||||||
proxy_send_timeout 10m;
|
proxy_send_timeout 10m;
|
||||||
proxy_read_timeout 10m;
|
proxy_read_timeout 10m;
|
||||||
|
|
||||||
client_max_body_size 100k;
|
client_max_body_size 100k;
|
||||||
send_timeout 10m;
|
send_timeout 10m;
|
||||||
'';
|
''+ nginxCommonHeaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Websocket
|
# Websocket
|
||||||
|
@ -580,7 +575,7 @@ in {
|
||||||
priority = 1220;
|
priority = 1220;
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_read_timeout 15m;
|
proxy_read_timeout 15m;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -590,84 +585,82 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."@api_websocket" = {
|
locations."@api_websocket" = {
|
||||||
proxyPass = "http://127.0.0.1:${toString cfg.listenHttp}";
|
proxyPass = "http://peertube";
|
||||||
priority = 1240;
|
priority = 1240;
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header Connection 'upgrade';
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Connection 'upgrade';
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
proxy_http_version 1.1;
|
'' + nginxCommonHeaders;
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Bypass PeerTube for performance reasons.
|
# Bypass PeerTube for performance reasons.
|
||||||
locations."~ ^/client/(assets/images/(icons/icon-36x36\.png|icons/icon-48x48\.png|icons/icon-72x72\.png|icons/icon-96x96\.png|icons/icon-144x144\.png|icons/icon-192x192\.png|icons/icon-512x512\.png|logo\.svg|favicon\.png|default-playlist\.jpg|default-avatar-account\.png|default-avatar-account-48x48\.png|default-avatar-video-channel\.png|default-avatar-video-channel-48x48\.png))$" = {
|
locations."~ ^/client/(assets/images/(icons/icon-36x36\.png|icons/icon-48x48\.png|icons/icon-72x72\.png|icons/icon-96x96\.png|icons/icon-144x144\.png|icons/icon-192x192\.png|icons/icon-512x512\.png|logo\.svg|favicon\.png|default-playlist\.jpg|default-avatar-account\.png|default-avatar-account-48x48\.png|default-avatar-video-channel\.png|default-avatar-video-channel-48x48\.png))$" = {
|
||||||
tryFiles = "/client-overrides/$1 /client/$1 $1";
|
tryFiles = "/client-overrides/$1 /client/$1 $1";
|
||||||
priority = 1310;
|
priority = 1310;
|
||||||
|
|
||||||
|
extraConfig = nginxCommonHeaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."~ ^/client/(.*\.(js|css|png|svg|woff2|otf|ttf|woff|eot))$" = {
|
locations."~ ^/client/(.*\.(js|css|png|svg|woff2|otf|ttf|woff|eot))$" = {
|
||||||
alias = "${cfg.package}/client/dist/$1";
|
alias = "${cfg.package}/client/dist/$1";
|
||||||
priority = 1320;
|
priority = 1320;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
add_header Cache-Control 'public, max-age=604800, immutable';
|
add_header Cache-Control 'public, max-age=604800, immutable';
|
||||||
'' + lib.optionalString cfg.enableWebHttps ''
|
'' + nginxCommonHeaders;
|
||||||
add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains';
|
|
||||||
'' + lib.optionalString config.services.nginx.virtualHosts.${cfg.localDomain}.http3 ''
|
|
||||||
add_header Alt-Svc 'h3=":443"; ma=86400';
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."^~ /download/" = {
|
locations."^~ /download/" = {
|
||||||
proxyPass = "http://127.0.0.1:${toString cfg.listenHttp}";
|
proxyPass = "http://peertube";
|
||||||
priority = 1410;
|
priority = 1410;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
proxy_limit_rate 5M;
|
proxy_limit_rate 5M;
|
||||||
'';
|
'' + nginxCommonHeaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."^~ /static/streaming-playlists/private/" = {
|
locations."^~ /static/streaming-playlists/hls/private/" = {
|
||||||
proxyPass = "http://127.0.0.1:${toString cfg.listenHttp}";
|
proxyPass = "http://peertube";
|
||||||
priority = 1420;
|
priority = 1420;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
proxy_limit_rate 5M;
|
proxy_limit_rate 5M;
|
||||||
'';
|
'' + nginxCommonHeaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."^~ /static/web-videos/private/" = {
|
locations."^~ /static/web-videos/private/" = {
|
||||||
proxyPass = "http://127.0.0.1:${toString cfg.listenHttp}";
|
proxyPass = "http://peertube";
|
||||||
priority = 1430;
|
priority = 1430;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
proxy_limit_rate 5M;
|
proxy_limit_rate 5M;
|
||||||
'';
|
'' + nginxCommonHeaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."^~ /static/webseed/private/" = {
|
locations."^~ /static/webseed/private/" = {
|
||||||
proxyPass = "http://127.0.0.1:${toString cfg.listenHttp}";
|
proxyPass = "http://peertube";
|
||||||
priority = 1440;
|
priority = 1440;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
proxy_limit_rate 5M;
|
proxy_limit_rate 5M;
|
||||||
'';
|
'' + nginxCommonHeaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."^~ /static/redundancy/" = {
|
locations."^~ /static/redundancy/" = {
|
||||||
|
@ -675,33 +668,35 @@ in {
|
||||||
root = cfg.settings.storage.redundancy;
|
root = cfg.settings.storage.redundancy;
|
||||||
priority = 1450;
|
priority = 1450;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
set $peertube_limit_rate 800k;
|
set $peertube_limit_rate 800k;
|
||||||
|
|
||||||
if ($request_uri ~ -fragmented.mp4$) {
|
if ($request_uri ~ -fragmented.mp4$) {
|
||||||
set $peertube_limit_rate 5M;
|
set $peertube_limit_rate 5M;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request_method = 'OPTIONS') {
|
if ($request_method = 'OPTIONS') {
|
||||||
${nginxCommonHeaders}
|
${nginxCommonHeaders}
|
||||||
add_header Access-Control-Max-Age 1728000;
|
${nginxCommonHeadersExtra}
|
||||||
add_header Content-Type 'text/plain charset=UTF-8';
|
add_header Access-Control-Max-Age 1728000;
|
||||||
add_header Content-Length 0;
|
add_header Content-Type 'text/plain charset=UTF-8';
|
||||||
return 204;
|
add_header Content-Length 0;
|
||||||
|
return 204;
|
||||||
}
|
}
|
||||||
if ($request_method = 'GET') {
|
if ($request_method = 'GET') {
|
||||||
${nginxCommonHeaders}
|
${nginxCommonHeaders}
|
||||||
|
${nginxCommonHeadersExtra}
|
||||||
|
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
aio threads;
|
aio threads;
|
||||||
sendfile on;
|
sendfile on;
|
||||||
sendfile_max_chunk 1M;
|
sendfile_max_chunk 1M;
|
||||||
|
|
||||||
limit_rate $peertube_limit_rate;
|
limit_rate $peertube_limit_rate;
|
||||||
limit_rate_after 5M;
|
limit_rate_after 5M;
|
||||||
|
|
||||||
rewrite ^/static/redundancy/(.*)$ /$1 break;
|
rewrite ^/static/redundancy/(.*)$ /$1 break;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -710,68 +705,72 @@ in {
|
||||||
root = cfg.settings.storage.streaming_playlists;
|
root = cfg.settings.storage.streaming_playlists;
|
||||||
priority = 1460;
|
priority = 1460;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
set $peertube_limit_rate 800k;
|
set $peertube_limit_rate 800k;
|
||||||
|
|
||||||
if ($request_uri ~ -fragmented.mp4$) {
|
if ($request_uri ~ -fragmented.mp4$) {
|
||||||
set $peertube_limit_rate 5M;
|
set $peertube_limit_rate 5M;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request_method = 'OPTIONS') {
|
if ($request_method = 'OPTIONS') {
|
||||||
${nginxCommonHeaders}
|
${nginxCommonHeaders}
|
||||||
add_header Access-Control-Max-Age 1728000;
|
${nginxCommonHeadersExtra}
|
||||||
add_header Content-Type 'text/plain charset=UTF-8';
|
add_header Access-Control-Max-Age 1728000;
|
||||||
add_header Content-Length 0;
|
add_header Content-Type 'text/plain charset=UTF-8';
|
||||||
return 204;
|
add_header Content-Length 0;
|
||||||
|
return 204;
|
||||||
}
|
}
|
||||||
if ($request_method = 'GET') {
|
if ($request_method = 'GET') {
|
||||||
${nginxCommonHeaders}
|
${nginxCommonHeaders}
|
||||||
|
${nginxCommonHeadersExtra}
|
||||||
|
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
aio threads;
|
aio threads;
|
||||||
sendfile on;
|
sendfile on;
|
||||||
sendfile_max_chunk 1M;
|
sendfile_max_chunk 1M;
|
||||||
|
|
||||||
limit_rate $peertube_limit_rate;
|
limit_rate $peertube_limit_rate;
|
||||||
limit_rate_after 5M;
|
limit_rate_after 5M;
|
||||||
|
|
||||||
rewrite ^/static/streaming-playlists/(.*)$ /$1 break;
|
rewrite ^/static/streaming-playlists/(.*)$ /$1 break;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."^~ /static/web-videos/" = {
|
locations."^~ /static/web-videos/" = {
|
||||||
tryFiles = "$uri @api";
|
tryFiles = "$uri @api";
|
||||||
root = cfg.settings.storage.streaming_playlists;
|
root = cfg.settings.storage.web_videos;
|
||||||
priority = 1470;
|
priority = 1470;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
set $peertube_limit_rate 800k;
|
set $peertube_limit_rate 800k;
|
||||||
|
|
||||||
if ($request_uri ~ -fragmented.mp4$) {
|
if ($request_uri ~ -fragmented.mp4$) {
|
||||||
set $peertube_limit_rate 5M;
|
set $peertube_limit_rate 5M;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request_method = 'OPTIONS') {
|
if ($request_method = 'OPTIONS') {
|
||||||
${nginxCommonHeaders}
|
${nginxCommonHeaders}
|
||||||
add_header Access-Control-Max-Age 1728000;
|
${nginxCommonHeadersExtra}
|
||||||
add_header Content-Type 'text/plain charset=UTF-8';
|
add_header Access-Control-Max-Age 1728000;
|
||||||
add_header Content-Length 0;
|
add_header Content-Type 'text/plain charset=UTF-8';
|
||||||
return 204;
|
add_header Content-Length 0;
|
||||||
|
return 204;
|
||||||
}
|
}
|
||||||
if ($request_method = 'GET') {
|
if ($request_method = 'GET') {
|
||||||
${nginxCommonHeaders}
|
${nginxCommonHeaders}
|
||||||
|
${nginxCommonHeadersExtra}
|
||||||
|
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
aio threads;
|
aio threads;
|
||||||
sendfile on;
|
sendfile on;
|
||||||
sendfile_max_chunk 1M;
|
sendfile_max_chunk 1M;
|
||||||
|
|
||||||
limit_rate $peertube_limit_rate;
|
limit_rate $peertube_limit_rate;
|
||||||
limit_rate_after 5M;
|
limit_rate_after 5M;
|
||||||
|
|
||||||
rewrite ^/static/streaming-playlists/(.*)$ /$1 break;
|
rewrite ^/static/web-videos/(.*)$ /$1 break;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -780,39 +779,37 @@ in {
|
||||||
root = cfg.settings.storage.web_videos;
|
root = cfg.settings.storage.web_videos;
|
||||||
priority = 1480;
|
priority = 1480;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
set $peertube_limit_rate 800k;
|
set $peertube_limit_rate 800k;
|
||||||
|
|
||||||
if ($request_uri ~ -fragmented.mp4$) {
|
if ($request_uri ~ -fragmented.mp4$) {
|
||||||
set $peertube_limit_rate 5M;
|
set $peertube_limit_rate 5M;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request_method = 'OPTIONS') {
|
if ($request_method = 'OPTIONS') {
|
||||||
${nginxCommonHeaders}
|
${nginxCommonHeaders}
|
||||||
add_header Access-Control-Max-Age 1728000;
|
${nginxCommonHeadersExtra}
|
||||||
add_header Content-Type 'text/plain charset=UTF-8';
|
add_header Access-Control-Max-Age 1728000;
|
||||||
add_header Content-Length 0;
|
add_header Content-Type 'text/plain charset=UTF-8';
|
||||||
return 204;
|
add_header Content-Length 0;
|
||||||
|
return 204;
|
||||||
}
|
}
|
||||||
if ($request_method = 'GET') {
|
if ($request_method = 'GET') {
|
||||||
${nginxCommonHeaders}
|
${nginxCommonHeaders}
|
||||||
|
${nginxCommonHeadersExtra}
|
||||||
|
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
aio threads;
|
aio threads;
|
||||||
sendfile on;
|
sendfile on;
|
||||||
sendfile_max_chunk 1M;
|
sendfile_max_chunk 1M;
|
||||||
|
|
||||||
limit_rate $peertube_limit_rate;
|
limit_rate $peertube_limit_rate;
|
||||||
limit_rate_after 5M;
|
limit_rate_after 5M;
|
||||||
|
|
||||||
rewrite ^/static/webseed/(.*)$ /web-videos/$1 break;
|
rewrite ^/static/webseed/(.*)$ /web-videos/$1 break;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfig = lib.optionalString cfg.enableWebHttps ''
|
|
||||||
add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains';
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user