:~# sudo certbot --nginx -d extunibusbooking.com -d www.extunibusbooking.com -v
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Certificate not yet due for renewal
You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.
(ref: /etc/letsencrypt/renewal/extunibusbooking.com.conf)
What would you like to do?
1: Attempt to reinstall this existing certificate
2: Renew & replace the certificate (may be subject to CA rate limits)
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Keeping the existing certificate
Deploying certificate
Could not install certificate
NEXT STEPS:
The certificate was saved, but could not be installed (installer: nginx). After fixing the error shown below, try installing it again by running:
certbot install --cert-name extunibusbooking.com
Could not automatically find a matching server block for extunibusbooking.com. Set the server_name directive to use the Nginx installer.
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.
help me?
Yes, I ran the command sudo certbot --nginx -d (my domain name) -d (my domain) -v but encountered an error. Certbot couldn't automatically find a matching server block for (my domain). I'm looking for guidance on how to set the server_name directive correctly.
Even though i set server name in the etc/nginx/sites-available/extunibusbooking.com. its like this: server {
listen 80;
server_name extunibusbooking.comwww.extunibusbooking.com;
You need a server block with server_name for your domain names. That server block needs to be part of the active nginx conf.
Often, there is an include statement in your nginx.conf file for a /sites-enabled/ folder. And, this is a symlink to a file in /sites-available/
But, technically you can use whatever folders you wish. It still needs to be part of the config that nginx knows about. You can see that with nginx -T
You need to learn how nginx is configured. What I am describing is very basic techniques. It is not specific to Let's Encrypt. Your site is not working right now probably because of these kinds of config problems.
You should focus on getting your nginx properly configured and your directories properly setup. The https://nginx.org site is a good reference. Once you can pass the Let's Debug test you can then try to get a certificate.