# OPTIONAL HTTP MODULES: Gzip, Headers, HTTP/2, Log, Real IP, SSL, Thread Pool, Upstream.
# THIRD PARTY MODULES: None.
-# Uncomment in production to redirect HTTP to HTTPS. Leave commented for docker-compose.
-#server {
-# listen 80;
-# listen [::]:80;
-# server_name ${WEBSERVER_HOST};
-#
-# location /.well-known/acme-challenge/ {
-# default_type "text/plain";
-# root /var/www/certbot;
-# }
-# location / { return 301 https://$host$request_uri; }
-#}
+server {
+ listen 80;
+ listen [::]:80;
+ server_name ${WEBSERVER_HOST};
+
+ location /.well-known/acme-challenge/ {
+ default_type "text/plain";
+ root /var/www/certbot;
+ }
+ location / { return 301 https://$host$request_uri; }
+}
upstream backend {
server ${PEERTUBE_HOST};
# Certificates
# you need a certificate to run in production. see https://letsencrypt.org/
##
- ssl_certificate /etc/letsencrypt/live/peertube/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/peertube/privkey.pem;
+ ssl_certificate /etc/letsencrypt/live/${WEBSERVER_HOST}/fullchain.pem;
+ ssl_certificate_key /etc/letsencrypt/live/${WEBSERVER_HOST}/privkey.pem;
location ^~ '/.well-known/acme-challenge' {
default_type "text/plain";
##
location @api {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 100k; # default is 1M
}
location = /api/v1/users/me/avatar/pick {
- limit_except POST { deny all; }
+ limit_except POST HEAD { deny all; }
- client_max_body_size 2M; # default is 1M
+ client_max_body_size 2M; # default is 1M
+ add_header X-File-Maximum-Size 2M always; # inform backend of the set value in bytes
try_files /dev/null @api;
}
location = /api/v1/videos/upload {
- limit_except POST { deny all; }
-
- # This is the maximum upload size, which roughly matches the maximum size of a video file
- # you can send via the API or the web interface. By default we set it to 8GB, but administrators
- # can increase or decrease the limit. Currently there's no way to communicate this limit
- # to users automatically, so you may want to leave a note in your instance 'about' page if
- # you change this.
- #
+ limit_except POST HEAD { deny all; }
+
+ # This is the maximum upload size, which roughly matches the maximum size of a video file.
# Note that temporary space is needed equal to the total size of all concurrent uploads.
# This data gets stored in /var/lib/nginx by default, so you may want to put this directory
# on a dedicated filesystem.
- client_max_body_size 8G; # default is 1M
+ client_max_body_size 8G; # default is 1M
+ add_header X-File-Maximum-Size 8G always; # inform backend of the set value in bytes
try_files /dev/null @api;
}