add client overrides to nginx configuration (#3297)

Co-authored-by: Rigel Kent <par@rigelk.eu>
Co-authored-by: kimsible <kimsible@users.noreply.github.com>
pull/3313/head
Kimsible 2020-11-16 10:34:05 +01:00 committed by GitHub
parent 2b8d7a7d59
commit 8872828d59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -64,6 +64,7 @@ for (const staticClientFile of staticClientFiles) {
clientsRouter.get('/manifest.webmanifest', asyncMiddleware(generateManifest))
// Static client overrides
// Must be consistent with static client overrides redirections in /support/nginx/peertube
const staticClientOverrides = [
'assets/images/logo.svg',
'assets/images/favicon.png',

View File

@ -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
```

View File

@ -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";