Home > Software engineering >  Certbot Redirection of HTTP to HTTPS from Nginx not working
Certbot Redirection of HTTP to HTTPS from Nginx not working

Time:05-17

enter image description here

enter image description here

I am trying to issue an SSL certificate for my website, although the message was successful (as attached image) but when accessing that domain, it is not working

CodePudding user response:

if you are using Cloudflare, go to SSS/TLS tab, then go to Overview, then on the right side of the page, select Full(strict)

CodePudding user response:

You must make sure to configure it in Nginx also:

ssl_certificate /path/to/certificate.crt;
ssl_certificate_key /path/to/certificate_key.key;

And make sure the server is listening on port 443.

If you want to force https:// then add a new nginx server declaration listening only on port 80 with the following:

location / {
    return 301 https://$host$request_uri;
}

There may be better ways to do that also, but I have little information to go on from this question, with no further information provided, I don't even know if you already did this or not, but it wouldn't work to just generate a cert, you also have to use it.

  • Related