aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/nginx/peertube
diff options
context:
space:
mode:
Diffstat (limited to 'support/nginx/peertube')
-rw-r--r--support/nginx/peertube35
1 files changed, 31 insertions, 4 deletions
diff --git a/support/nginx/peertube b/support/nginx/peertube
index b00031133..fee0f5d1c 100644
--- a/support/nginx/peertube
+++ b/support/nginx/peertube
@@ -41,7 +41,7 @@ server {
41 # It might be nice to compress JSON, but leaving that out to protect against potential 41 # It might be nice to compress JSON, but leaving that out to protect against potential
42 # compression+encryption information leak attacks like BREACH. 42 # compression+encryption information leak attacks like BREACH.
43 gzip on; 43 gzip on;
44 gzip_types text/css text/html application/javascript; 44 gzip_types text/css application/javascript;
45 gzip_vary on; 45 gzip_vary on;
46 46
47 # Enable HSTS 47 # Enable HSTS
@@ -96,8 +96,18 @@ server {
96 proxy_set_header Host $host; 96 proxy_set_header Host $host;
97 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 97 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
98 98
99 # Hard limit, PeerTube does not support videos > 8GB 99 # This is the maximum upload size, which roughly matches the maximum size of a video file
100 # you can send via the API or the web interface. By default this is 8GB, but administrators
101 # can increase or decrease the limit. Currently there's no way to communicate this limit
102 # to users automatically, so you may want to leave a note in your instance 'about' page if
103 # you change this.
104 #
105 # Note that temporary space is needed equal to the total size of all concurrent uploads.
106 # This data gets stored in /var/lib/nginx by default, so you may want to put this directory
107 # on a dedicated filesystem.
108 #
100 client_max_body_size 8G; 109 client_max_body_size 8G;
110
101 proxy_connect_timeout 600; 111 proxy_connect_timeout 600;
102 proxy_send_timeout 600; 112 proxy_send_timeout 600;
103 proxy_read_timeout 600; 113 proxy_read_timeout 600;
@@ -105,7 +115,7 @@ server {
105 } 115 }
106 116
107 # Bypass PeerTube for performance reasons. Could be removed 117 # Bypass PeerTube for performance reasons. Could be removed
108 location /static/webseed { 118 location ~ ^/static/(webseed|redundancy)/ {
109 # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client 119 # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client
110 limit_rate 800k; 120 limit_rate 800k;
111 121
@@ -128,7 +138,12 @@ server {
128 access_log off; 138 access_log off;
129 } 139 }
130 140
131 alias /var/www/peertube/storage/videos; 141 root /var/www/peertube/storage;
142
143 rewrite ^/static/webseed/(.*)$ /videos/$1 break;
144 rewrite ^/static/redundancy/(.*)$ /redundancy/$1 break;
145
146 try_files $uri /;
132 } 147 }
133 148
134 # Websocket tracker 149 # Websocket tracker
@@ -143,4 +158,16 @@ server {
143 proxy_set_header Host $host; 158 proxy_set_header Host $host;
144 proxy_pass http://localhost:9000; 159 proxy_pass http://localhost:9000;
145 } 160 }
161
162 location /socket.io {
163 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
164 proxy_set_header Host $host;
165
166 proxy_pass http://localhost:9000;
167
168 # enable WebSockets
169 proxy_http_version 1.1;
170 proxy_set_header Upgrade $http_upgrade;
171 proxy_set_header Connection "upgrade";
172 }
146} 173}