Http -> https redirect only seems to work after selecting no redirect

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:
stevenmos.xyz

I ran this command:
certbot --nginx

It produced this output:

My web server is (include version):
nginx version: nginx/1.16.1

The operating system my web server runs on is (include version):
Alpine Linux 3.11

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don't know):
Y
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
N
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):
certbot 1.0.0


When I first ran certbot and selected redirect to https the redirect didn't work but when I ran it again and selected try re-installation and no https redirect, the https redirect worked.

Is this likely a problem with me, alpine, or certbot, or something else?

1 Like

I gave this a shot on Alpine 3.11.

The redirect worked for me on the first try, provided that I was accessing a domain that was protected by the certificate.

If you are ever able to reproduce this again, I think it would be helpful to save the /var/log/letsencrypt/letsencrypt.log, and also check what modifications Certbot has done to your nginx configuration (the return 301 parts).

1 Like

That may need some love.

Predictably, the problem was me. The first run didn't work properly because I hadn't set www.* up correctly with my registrar and it all snowballed from there.

I started again with certbot delete and it worked first time.

2 Likes