Configure NGINX to Redirect Default Site to SSL Site

Configure the server to serve a redirect:

cat > /tmp/default-redirect<< EOF
server {
    listen 80;
 
    rewrite (.*) https://\$http_host$1 permanent;
}
EOF
 
sudo mv /tmp/default-redirect /etc/nginx/sites-available/
 
sudo ln -s /etc/nginx/sites-available/default-redirect /etc/nginx/sites-enabled/default-redirect
 
sudo service nginx reload