server { listen 80; server_name eond.com www.eond.com; rewrite ^/(.*) https://eond.com/$1 permanent; } server { listen 443 ssl http2; server_name www.eond.com; ssl_certificate /etc/letsencrypt/live/eond.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/eond.com/privkey.pem; rewrite ^/(.*) https://eond.com/$1 permanent; } server { listen 443 ssl http2; server_name eond.com; ssl_certificate /etc/letsencrypt/live/eond.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/eond.com/privkey.pem; [ stuff goes here ] }