Error while certbot --nginx -d

My domain is: quickmailai.com

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

It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for quickmailai.com and www.quickmailai.com

Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Domain: quickmailai.com
Type: unauthorized
Detail: 2a06:98c1:58::60: Invalid response from http://quickmailai.com/.well-known/acme-challenge/XYEbN1BznoBhngZmS_WDUtxBiv15AfyAp0zAMXRUVRI: 404

Domain: www.quickmailai.com
Type: unauthorized
Detail: 2606:4700:7::60: Invalid response from http://www.quickmailai.com/.well-known/acme-challenge/SCnmAVpgWtwqPVCjN2tFxIqJdTc0pl6R63LNcFKUb7Y: 404

Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.

Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

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

The operating system my web server runs on is (include version): Ubuntu 24.04

My hosting provider, if applicable, is: Digital Ocean Droplet

I can login to a root shell on my machine (yes or no, or I don't know): Yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): No

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 2.9.0

Welcome @minhtuan-ne

Can you explain more what you are trying to do? Because your DNS config is unusual and is the reason you have problems getting a cert.

Four of your five DNS A and AAAA records point to Cloudflare CDN edge as if you have your domain proxied there. But, your name servers are for digitalocean - not Cloudflare. And, you have one IPv4 A record that points directly to an nginx server at digitalocean. When proxying names you don't mix DNS entries like this.

If you need help setting up Cloudflare DNS and proxy please consult their docs and community. Otherwise, remove the 4 DNS records related to them leaving just your A record for the digitalocean nginx.

5 Likes

Supplemental or redundant information.
Here is what Let's Debug sees.

And DNS

2 Likes

Thanks guys, I will try to host my server on Cloudfare

1 Like

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