HTTPS:// is not working on Nginx

My domain is: http://indiasaplings.com/

I ran this command: sudo certbot --nginx -d indiasaplings.com -d www.indiasaplings.com

It produced this output:

IMPORTANT NOTES:

Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/indiasaplings.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/indiasaplings.com/privkey.pem
Your cert will expire on 2019-12-29. To obtain a new or tweaked
version of this certificate in the future, simply run certbot again
with the “certonly” option. To non-interactively renew all of
your certificates, run “certbot renew”
  • CMS: Mazento 2
  • Web Server: Nginx
  • OS: Ubuntu 18.04
  • Hosting: AWS

Here is my server block:-

server {
   # if ($host = indiasaplings.com) {
    #    return 301 https://$host$request_uri;
   # } # managed by Certbot


    listen 80;
    server_name indiasaplings.com www.indiasaplings.com;
   # return 301 https://indiasaplings.com$request_uri;
    set $MAGE_ROOT /var/www/html/sm/sm_shopee;
    set $MAGE_DEBUG_SHOW_ARGS 1;
    include /etc/nginx/m2/m231.conf;


}

server {
    listen 443 ssl;
    server_name indiasaplings.com www.indiasaplings.com;
  # return 301 https://indiasaplings.com$request_uri;
    set $MAGE_ROOT /var/www/html/sm/sm_shopee;
    set $MAGE_DEBUG_SHOW_ARGS 1;
    include /etc/nginx/m2/m231.conf;
    ssl_certificate /etc/letsencrypt/live/indiasaplings.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/indiasaplings.com/privkey.pem; # managed by Certbot


}

server {
    listen              443 ssl default_server;
    listen              [::]:443 ssl default_server;
    server_name         indiasaplings.com www.indiasaplings.com;
    set $MAGE_ROOT /var/www/hmtl/sm/sm_shopee;
    set $MAGE_DEBUG_SHOW_ARGS 1;
   include /etc/nginx/m2/m231.conf;

    }

I am not able to open my site on HTTPS:// even after installing and configuring Let’s Encrypt. Please guide, Thank you!

1 Like

Hi @TechieBraj

you have created a lot of certificates - https://check-your-website.server-daten.de/?q=indiasaplings.com

Issuer not before not after Domain names LE-Duplicate next LE
Let's Encrypt Authority X3 2019-09-30 2019-12-29 indiasaplings.com, www.indiasaplings.com - 2 entries duplicate nr. 2
Let's Encrypt Authority X3 2019-09-30 2019-12-29 indiasaplings.com, www.indiasaplings.com - 2 entries duplicate nr. 1
Let's Encrypt Authority X3 2019-09-30 2019-12-29 indiasaplings.com - 1 entries duplicate nr. 1
Encryption Everywhere DV TLS CA - G1 2019-09-30 2020-09-29 *.indiasaplings.com, indiasaplings.com - 2 entries
Encryption Everywhere DV TLS CA - G1 2019-09-30 2020-09-29 *.indiasaplings.com, indiasaplings.com - 2 entries
Amazon 2019-09-30 2020-10-30 indiasaplings.com - 1 entries
Amazon 2019-09-29 2020-10-29 *.indiasaplings.com, indiasaplings.com, www.indiasaplings.com - 3 entries
Amazon 2019-09-29 2020-10-29 *.indiasaplings.com, indiasaplings.com, www.indiasaplings.com - 3 entries
Amazon 2019-09-29 2020-10-29 *.indiasaplings.com, indiasaplings.com, www.indiasaplings.com - 3 entries

But your domain is invisible. http and https:

Domainname Http-Status redirect Sec. G
• http://indiasaplings.com/
18.217.60.107 -14 10.037 T
Timeout - Timeout fĂĽr Vorgang ĂĽberschritten
• http://www.indiasaplings.com/
18.217.60.107 -14 10.053 T
Timeout - Timeout fĂĽr Vorgang ĂĽberschritten
• https://indiasaplings.com/
18.217.60.107 -14 10.044 T
Timeout - Timeout fĂĽr Vorgang ĂĽberschritten
• https://www.indiasaplings.com/
18.217.60.107 -14 10.040 T
Timeout - Timeout fĂĽr Vorgang ĂĽberschritten

Looks like a blocking firewall. If you use AWS, you must allow port 80 and port 443.

2 Likes

There were two server blocks with both listen 443 and server_name indiasaplings.com. One had the certificate files configured; the second was missing them. I removed the 443 blocks without certificate files, and it worked.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.