diff options
author | Kimsible <1877318+kimsible@users.noreply.github.com> | 2020-11-16 10:34:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-16 10:34:05 +0100 |
commit | 8872828d59a5152e27734711ae30ebe86e84f570 (patch) | |
tree | 81c1e997c367d9852ec92643b16fc6885e0cacb1 | |
parent | 2b8d7a7d590ff71bf143c89d95a2289a1d6d3d85 (diff) | |
download | PeerTube-8872828d59a5152e27734711ae30ebe86e84f570.tar.gz PeerTube-8872828d59a5152e27734711ae30ebe86e84f570.tar.zst PeerTube-8872828d59a5152e27734711ae30ebe86e84f570.zip |
add client overrides to nginx configuration (#3297)
Co-authored-by: Rigel Kent <par@rigelk.eu>
Co-authored-by: kimsible <kimsible@users.noreply.github.com>
-rw-r--r-- | server/controllers/client.ts | 1 | ||||
-rw-r--r-- | support/doc/docker-traefik.md | 4 | ||||
-rw-r--r-- | support/nginx/peertube | 10 |
3 files changed, 13 insertions, 2 deletions
diff --git a/server/controllers/client.ts b/server/controllers/client.ts index 335a0e082..592233676 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts | |||
@@ -64,6 +64,7 @@ for (const staticClientFile of staticClientFiles) { | |||
64 | clientsRouter.get('/manifest.webmanifest', asyncMiddleware(generateManifest)) | 64 | clientsRouter.get('/manifest.webmanifest', asyncMiddleware(generateManifest)) |
65 | 65 | ||
66 | // Static client overrides | 66 | // Static client overrides |
67 | // Must be consistent with static client overrides redirections in /support/nginx/peertube | ||
67 | const staticClientOverrides = [ | 68 | const staticClientOverrides = [ |
68 | 'assets/images/logo.svg', | 69 | 'assets/images/logo.svg', |
69 | 'assets/images/favicon.png', | 70 | 'assets/images/favicon.png', |
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 | |||
24 | ``` | 24 | ``` |
25 | Needs to have file mode 600: | 25 | Needs to have file mode 600: |
26 | ```shell | 26 | ```shell |
27 | chmod 600 ./docker-volume/traefik/acme.json | 27 | chmod 600 ./docker-volume/traefik/acme.json |
28 | ``` | 28 | ``` |
29 | 29 | ||
30 | #### Update the reverse proxy configuration | 30 | #### Update the reverse proxy configuration |
@@ -40,5 +40,5 @@ More at: https://docs.traefik.io/v1.7 | |||
40 | #### Run with traefik | 40 | #### Run with traefik |
41 | 41 | ||
42 | ```shell | 42 | ```shell |
43 | docker-compose -f docker-compose.yml docker-compose.traefik.yml up -d | 43 | docker-compose -f docker-compose.yml -f docker-compose.traefik.yml up -d |
44 | ``` | 44 | ``` |
diff --git a/support/nginx/peertube b/support/nginx/peertube index 7f2c0f263..e58659030 100644 --- a/support/nginx/peertube +++ b/support/nginx/peertube | |||
@@ -58,6 +58,16 @@ server { | |||
58 | } | 58 | } |
59 | 59 | ||
60 | # Bypass PeerTube for performance reasons. Could be removed | 60 | # Bypass PeerTube for performance reasons. Could be removed |
61 | # Should be consistent with client-overrides assets list in /server/controllers/client.ts | ||
62 | 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))$ { | ||
63 | add_header Cache-Control "public, max-age=31536000, immutable"; | ||
64 | |||
65 | root /var/www/peertube/storage/client-overrides; | ||
66 | |||
67 | try_files /$1 $uri; | ||
68 | } | ||
69 | |||
70 | # Bypass PeerTube for performance reasons. Could be removed | ||
61 | location ~ ^/client/(.*\.(js|css|png|svg|woff2|otf|ttf|woff|eot))$ { | 71 | location ~ ^/client/(.*\.(js|css|png|svg|woff2|otf|ttf|woff|eot))$ { |
62 | add_header Cache-Control "public, max-age=31536000, immutable"; | 72 | add_header Cache-Control "public, max-age=31536000, immutable"; |
63 | 73 | ||