From f162d32da098aa55f6de2367142faa166edb7c08 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 6 Jun 2023 15:59:51 +0200 Subject: Support lazy download thumbnails --- support/nginx/peertube | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'support/nginx') 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 { alias /var/www/peertube/peertube-latest/client/dist/$1; } - # Bypass PeerTube for performance reasons. Optional. - location ~ ^/static/(thumbnails|avatars)/ { - if ($request_method = 'OPTIONS') { - 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'; - add_header Access-Control-Max-Age 1728000; # Preflight request can be cached 20 days - add_header Content-Type 'text/plain charset=UTF-8'; - add_header Content-Length 0; - return 204; - } - - 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'; - add_header Cache-Control "public, max-age=7200"; # Cache response 2 hours - - rewrite ^/static/(.*)$ /$1 break; - - try_files $uri @api; - } - location ~ ^(/static/(webseed|streaming-playlists)/private/)|^/download { # We can't rate limit a try_files directive, so we need to duplicate @api -- cgit v1.2.3