[SOLVED] Cannot find a VirtualHost matching domain with nginx

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: moerman.online

I ran this command: sudo certbot --nginx -d home.moerman.online

It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for home.moerman.online
Cleaning up challenges
Cannot find a VirtualHost matching domain home.moerman.online.

My web server is (include version): nginx 1.10.3

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

My hosting provider, if applicable, is: none. Running on local server

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

I have nginx configured with the proper VirtualHost file in /etc/nginx/sites-available with a symlink from /etc/nginx/sites-enabled.
Content of the home.moerman.online file:
server {
listen 80;
server_name home.moerman.online;

    root /var/www/home/html;
    index index.html index.htm index.nginx-debian.html;
    location / {
            try_files $uri $uri/ =404;
    }

}

And finally nginx -t gives no errors.

Could you show the output of nginx -T and also ls -R /etc/nginx ?

Sorry, my bad! I had changed some settings and forgot to restart nginx. The VirtualHost config is recognized properly now… ;o|

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