I am running an EC2 instance.
OS: Ubuntu 20.04.4 LTS
Server is running on NGINX
Issue: I am trying to renew the certificates but when I do, i get this error
I am using sudo certbot --nginx certonly to renew the certificate.
The error message
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: backend-prod.chainwhiz.app
2: www.backend-prod.chainwhiz.app
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
You have an existing certificate that contains a portion of the domains you
requested (ref: /etc/letsencrypt/renewal/backend-prod.chainwhiz.app.conf)
It contains these names: backend-prod.chainwhiz.app
You requested these names for the new certificate: backend-prod.chainwhiz.app,
www.backend-prod.chainwhiz.app.
Do you want to expand and replace this existing certificate with the new
certificate?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(E)xpand/(C)ancel: E
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for www.backend-prod.chainwhiz.app
http-01 challenge for backend-prod.chainwhiz.app
nginx: [warn] conflicting server name "backend-prod.chainwhiz.app" on [::]:80, ignored
nginx: [warn] conflicting server name "www.backend-prod.chainwhiz.app" on [::]:80, ignored
nginx: [warn] conflicting server name "backend-prod.chainwhiz.app" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "www.backend-prod.chainwhiz.app" on 0.0.0.0:80, ignored
Waiting for verification...
Challenge failed for domain www.backend-prod.chainwhiz.app
Challenge failed for domain backend-prod.chainwhiz.app
http-01 challenge for www.backend-prod.chainwhiz.app
http-01 challenge for backend-prod.chainwhiz.app
Cleaning up challenges
nginx: [warn] conflicting server name "backend-prod.chainwhiz.app" on [::]:80, ignored
nginx: [warn] conflicting server name "www.backend-prod.chainwhiz.app" on [::]:80, ignored
nginx: [warn] conflicting server name "backend-prod.chainwhiz.app" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "www.backend-prod.chainwhiz.app" on 0.0.0.0:80, ignored
Some challenges have failed.
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: www.backend-prod.chainwhiz.app
Type: unauthorized
Detail: 13.58.80.238: Invalid response from
http://www.backend-prod.chainwhiz.app/.well-known/acme-challenge/Ge52LnBkFWQ2iUU6U4KUFmFcX6-E75Y6wkfCUBtN0L8:
404
Domain: backend-prod.chainwhiz.app
Type: unauthorized
Detail: 13.58.80.238: Invalid response from
http://backend-prod.chainwhiz.app/.well-known/acme-challenge/QxGdJDtb3dJlb1HnNfSjM_W6ANMIinLpSHpZtxjl0rI:
404
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
It seems like the simplest resolve to that conflict is to remove/disable the file: /etc/nginx/sites-enabled/backend-prod.chainwhiz.app
[which would allow unencrypted access to your site]
If you don't think you will ever need that file again, yes (you can delete the file).
If you think you might need it (or just want to keep it), then you need to delete only the link to the file.
The file is in the /sites-available/ folder.
The link is in the /sites-enabled/ folder.