Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add client overrides to nginx configuration #3297

Merged
merged 4 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/controllers/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions support/doc/docker-traefik.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```
10 changes: 10 additions & 0 deletions support/nginx/peertube
Original file line number Diff line number Diff line change
Expand Up @@ -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;

try_files /storage/client-overrides/$1 /peertube-latest/client/dist/$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";
Expand Down