I ran this command: sudo certbot certonly --nginx --dry-run
Other ran commands:
sudo certbot certonly -d task-tag.co.uk --dry-run
sudo certbot renew --force-renewal
After many trials, I tried these (below) and then repeat the first command and sudo certbot --nginx. Always same error.
sudo certbot delete
sudo certbot revoke
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter âcâ to cancel): 1
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for task-tag.co.uk
nginx: [warn] conflicting server name âtask-tag.co.ukâ on 0.0.0.0:80, ignored
Waiting for verificationâŚ
Cleaning up challenges
nginx: [warn] conflicting server name âtask-tag.co.ukâ on 0.0.0.0:80, ignored
Failed authorization procedure. task-tag.co.uk (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://task-tag.co.uk/.well-known/acme-challenge/Mr6S__Lz1l8cjxeL0t94ipo2UBz7jAGTrhxo_ZBjtlg [35.178.212.206]: 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.
My web server is (include version): Nginx 1.14.0
The operating system my web server runs on is (include version): Linux-5.3.0-1017-aws-x86_64-with-Ubuntu-18.04-bionic
My hosting provider, if applicable, is: AWS
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, simply SSH.
The version of my client is (e.g. output of certbot --version or certbot-auto --version if youâre using Certbot): 0.27.0
Thatâs because I have the same domain but for different port.
The one without port had SSL and the one with port didnt use SSL. It was working fine like this but I forgot to renew the certificate and now im having this issue.
I see. within nginx/sites-enabled/ I have two files: one for the default port and the other one with a specific port. I will try simply having the default port one first and see how it goes.
Indeed that fixed the problem. Itâs now working with only one site enabled. Thank you very much. Now, I just need to figure out how to add it as well for the specific port. Do you have any ideas about this?
Yes definitely the problem is clear. Is there any possibility to have the SSL Certificate under that 8001 port? otherwise, I will leave this one without SSL Certificate, it should be alright by now.
You already do. sites-enabled/dns2 has a valid cert for that name and is listening on two ports (8001 and 443).
But in that same block it also listens on 443 (needlessly).
And further down adds a listen to port 80 with overlaps with the other file - one needs to be removed.
YES! That was it. i had to add listen 8001 ssl; and it worked.
Thank you very much for your help @rg305 too as I could create a better config.
Thanks a lot.