Hi,
I’m using certbot-auto to create auto SSL but for some reason the --redirect flag leaves the Nginx rules commented out.
Here is my log
sudo /opt/letsencrypt/certbot-auto --debug --email admin@example.com --no-eff-email --agree-tos -n --nginx --keep -d mysite.com
Plugins selected: Authenticator nginx, Installer nginx
Cert not yet due for renewal
Keeping the existing certificate
Deployed Certificate to VirtualHost /etc/nginx/sites-enabled/mysite_com.conf for set(['mysite.com'])
The appropriate server block is already redirecting traffic. To enable redirect anyway, uncomment the redirect lines in /etc/nginx/sites-enabled/mysite_com.conf.
Then the mysite_com.conf will include
# Redirect non-https traffic to https
# if ($scheme != "https") {
# return 301 https://$host$request_uri;
# } # managed by Certbot
For some reason it i s commented and I am not sure why. Any idea how to automate this without having to apply any string replacement?
Thanks