server { listen 80; listen [::]:80; server_name aprilandtrey.us www.aprilandtrey.us treyandapril.us www.treyandapril.us; return 301 https://aprilandtrey.us$request_uri; # Redirect non-https traffic to https # if ($scheme != "https") { # return 301 https://$host$request_uri; # } # managed by Certbot } server { listen 443 ssl; server_name aprilandtrey.us www.aprilandtrey.us treyandapril.us www.treyandapril.us; ssl_certificate /etc/letsencrypt/live/aprilandtrey.us/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/aprilandtrey.us/privkey.pem; # managed by Certbot root /var/www/aprilandtrey.us/; location / { client_max_body_size 364M; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://aprilandtrey:2368; proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600; } }