tusd/.infra/files/nginx.conf

59 lines
2.1 KiB
Nginx Configuration File
Raw Normal View History

2016-11-04 17:54:35 +00:00
server {
2017-01-26 21:31:35 +00:00
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
2016-11-04 17:54:35 +00:00
2017-01-24 08:47:06 +00:00
listen 443 http2 ssl;
listen [::]:443 http2 ipv6only=on ssl;
2016-11-09 21:56:15 +00:00
ssl_certificate /etc/letsencrypt/live/master.tus.io/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/master.tus.io/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/master.tus.io/fullchain.pem;
2016-11-09 20:44:24 +00:00
# Load custom parameters for Diffie Hellman key exchange to avoid the usage
# of common primes
ssl_dhparam /etc/nginx/dhparams.pem;
2016-11-09 21:56:15 +00:00
# Enable OCSP stapling which allows clients to verify that our certificate
# is not revoked without contacting the Certificate Authority by appending a
# CA-signed promise, that it's still valid, to the TLS handshake response.
ssl_stapling on;
ssl_stapling_verify on;
# Enable SSL session cache to reduce overhead of TLS handshake. Allow nginx
# workers to use 5MB of memory for caching but disable session tickets as
# there is currently no easy way to rotate the ticket key which is not in
# sync with the ideals of Perfect Forward Secrecy.
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:5m;
ssl_session_tickets off;
2016-11-04 17:54:35 +00:00
server_name master.tus.io;
2016-11-04 18:51:39 +00:00
# certbot will place the files required for the HTTP challenge in the
# webroot under the .well-known/acme-challenge directory. Therefore we must
# make this path publicly accessible.
location /.well-known {
root /mnt/nginx-www/;
}
2016-11-04 17:54:35 +00:00
location / {
# Forward incoming requests to local tusd instance
proxy_pass http://localhost:8080;
# Disable request and response buffering
proxy_request_buffering off;
proxy_buffering off;
proxy_http_version 1.1;
# Add X-Forwarded-* headers
proxy_set_header X-Forwarded-Host $hostname;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_max_body_size 0;
add_header King marius;
}
}