aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/nginx
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-06-06 15:59:51 +0200
committerChocobozzz <me@florianbigard.com>2023-06-29 10:19:33 +0200
commitf162d32da098aa55f6de2367142faa166edb7c08 (patch)
tree31c6a96972994171853cb6c4e0b88b63241f8979 /support/nginx
parenta673d9e848e51186602548a621e05925663b98be (diff)
downloadPeerTube-f162d32da098aa55f6de2367142faa166edb7c08.tar.gz
PeerTube-f162d32da098aa55f6de2367142faa166edb7c08.tar.zst
PeerTube-f162d32da098aa55f6de2367142faa166edb7c08.zip
Support lazy download thumbnails
Diffstat (limited to 'support/nginx')
-rw-r--r--support/nginx/peertube22
1 files changed, 0 insertions, 22 deletions
diff --git a/support/nginx/peertube b/support/nginx/peertube
index 05a59c072..f5b9d131a 100644
--- a/support/nginx/peertube
+++ b/support/nginx/peertube
@@ -199,28 +199,6 @@ 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 # Bypass PeerTube for performance reasons. Optional.
203 location ~ ^/static/(thumbnails|avatars)/ {
204 if ($request_method = 'OPTIONS') {
205 add_header Access-Control-Allow-Origin '*';
206 add_header Access-Control-Allow-Methods 'GET, OPTIONS';
207 add_header Access-Control-Allow-Headers 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
208 add_header Access-Control-Max-Age 1728000; # Preflight request can be cached 20 days
209 add_header Content-Type 'text/plain charset=UTF-8';
210 add_header Content-Length 0;
211 return 204;
212 }
213
214 add_header Access-Control-Allow-Origin '*';
215 add_header Access-Control-Allow-Methods 'GET, OPTIONS';
216 add_header Access-Control-Allow-Headers 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
217 add_header Cache-Control "public, max-age=7200"; # Cache response 2 hours
218
219 rewrite ^/static/(.*)$ /$1 break;
220
221 try_files $uri @api;
222 }
223
224 location ~ ^(/static/(webseed|streaming-playlists)/private/)|^/download { 202 location ~ ^(/static/(webseed|streaming-playlists)/private/)|^/download {
225 # 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
226 204