Changing servers from apache to nginx, Unable to install the certificate

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command:
sudo certbot --nginx

It produced this output:
Keeping the existing certificate
Could not automatically find a matching server block for win.interstagebpm.com. Set the server_name directive to use the Nginx installer.

IMPORTANT NOTES:

  • Unable to install the certificate
  • Congratulations! Your certificate and chain have been saved at:
    /etc/letsencrypt/live/win.interstagebpm.com/fullchain.pem
    Your key file has been saved at:
    /etc/letsencrypt/live/win.interstagebpm.com/privkey.pem
    Your cert will expire on 2020-03-04. 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”
    [root@dxpdemo ~]# Set the server_name directive to use the Nginx installer.

My web server is (include version):
nginx (whatever version it is from yum install nginx)

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

My hosting provider, if applicable, is:
azure

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-auto --version
certbot 1.1.0

1 Like

This is good:

This is … well maybe something you need to do manually (at least the first time).

So... Let's get that cert installed!
Please show the vhost config that would be using that cert.
OR the complete nginx config is not too big.
nginx -T

1 Like

I resolved this by putting the server name instead of localhost
server {
server_name localhost;

I changed localhost to my signed certificate domain name

2 Likes

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