+ access_log /var/log/nginx/peertube_access.log;
+ error_log /var/log/nginx/peertube_error.log;
+
+ location /.well-known/acme-challenge/ { allow all; }
+ location / { return 301 https://$host$request_uri; }
+}
+
+server {
+ listen 443 ssl http2;
+ # listen [::]:443 ssl http2;
+ server_name domain.tld;
+
+ access_log /var/log/nginx/peertube_access.log;
+ error_log /var/log/nginx/peertube_error.log;
+
+ # For example with Let's Encrypt
+ ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;
+ ssl_trusted_certificate /etc/letsencrypt/live/domain.tld/chain.pem;
+
+ location ~ ^/client/(.*\.(js|css|woff2|otf|ttf|woff|eot))$ {
+ add_header Cache-Control "public, max-age=31536000, immutable";
+
+ alias /home/peertube/peertube-latest/client/dist/$1;
+ }
+
+ location ~ ^/static/(thumbnails|avatars)/(.*)$ {
+ add_header Cache-Control "public, max-age=31536000, immutable";
+
+ alias /home/peertube/storage/$1/$2;
+ }
+