From 8872828d59a5152e27734711ae30ebe86e84f570 Mon Sep 17 00:00:00 2001 From: Kimsible <1877318+kimsible@users.noreply.github.com> Date: Mon, 16 Nov 2020 10:34:05 +0100 Subject: add client overrides to nginx configuration (#3297) Co-authored-by: Rigel Kent Co-authored-by: kimsible --- support/doc/docker-traefik.md | 4 ++-- support/nginx/peertube | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'support') diff --git a/support/doc/docker-traefik.md b/support/doc/docker-traefik.md index eb480ec53..4c03cce42 100644 --- a/support/doc/docker-traefik.md +++ b/support/doc/docker-traefik.md @@ -24,7 +24,7 @@ touch ./docker-volume/traefik/acme.json ``` Needs to have file mode 600: ```shell -chmod 600 ./docker-volume/traefik/acme.json +chmod 600 ./docker-volume/traefik/acme.json ``` #### Update the reverse proxy configuration @@ -40,5 +40,5 @@ More at: https://docs.traefik.io/v1.7 #### Run with traefik ```shell -docker-compose -f docker-compose.yml docker-compose.traefik.yml up -d +docker-compose -f docker-compose.yml -f docker-compose.traefik.yml up -d ``` diff --git a/support/nginx/peertube b/support/nginx/peertube index 7f2c0f263..e58659030 100644 --- a/support/nginx/peertube +++ b/support/nginx/peertube @@ -57,6 +57,16 @@ server { root /var/www/certbot; } + # Bypass PeerTube for performance reasons. Could be removed + # Should be consistent with client-overrides assets list in /server/controllers/client.ts + location ~ ^/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))$ { + add_header Cache-Control "public, max-age=31536000, immutable"; + + root /var/www/peertube/storage/client-overrides; + + try_files /$1 $uri; + } + # Bypass PeerTube for performance reasons. Could be removed location ~ ^/client/(.*\.(js|css|png|svg|woff2|otf|ttf|woff|eot))$ { add_header Cache-Control "public, max-age=31536000, immutable"; -- cgit v1.2.3