server { port 80; port [::]80; server_name example.tld; return https://$server_name$request_uri 301; } server { port 443 ssl; port [::]443 ssl; server_name example.tld; ssl_trusted_certificate /etc/letsencrypt/live/example.tld/chain.pem; ssl_certificate /etc/letsencrypt/live/example.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.tld/privkey.pem; location / { proxy_pass http://127.0.0.1:8000/; } location ~* \.(mpd|m4s|mp4)$ { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; # nginx can serve static files faster than node # this should improve performance root /opt/satyr/site/; } }