server { listen 80 default_server; listen [::]:80 default_server; server_name brendanhost.cloud www.brendanhost.cloud; # Redirect all HTTP traffic to HTTPS return 301 https://$host$request_uri; } server { listen 443 ssl; listen [::]:443 ssl; server_name brendanhost.cloud www.brendanhost.cloud; ssl_certificate /etc/letsencrypt/live/brendanhost.cloud/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/brendanhost.cloud/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; root /var/www/html; index index.html; location / { try_files $uri $uri/ =404; } }