Error upon running certbot-auto first time SOLVED

I am getting this message (no certs found):

Cannot find a VirtualHost matching domain .net.

Linux Debian server 7.3

Hi @ranch,

What command did you run?

is this a TYPO "domain .net"?

Thanks for replying. I meant to put in the sequence I entered.

sudo ./certbot-auto --nginx

Then I tried:

sudo ./certbot-auto --nginx certonly

The domain name was auto replaced with ‘domain .net’ by the forum site. My correct DN was entered into the instruction line.

How did you tell Certbot your domain name?

root@me~# sudo ./certbot-auto --nginx certonly
Saving debug log to /var/log/letsencrypt/letsencrypt.log
No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated) (Enter ‘c’ to cancel):

I entered it at the above : in the format ‘

Do you have an nginx configuration file for that name? Can you post the configuration file and also the location where it’s saved?

Don’t see anything in there. I don’t remember having to do anything like that with another server I set up. Can you tell me what needs to be entered?

cat /etc/nginx.conf

user www-data;
worker_processes 4;
pid /run/;

events {
worker_connections 768;
# multi_accept on;

http {

    # Basic Settings

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    # SSL Settings

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    # Logging Settings

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    # Gzip Settings

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    # Virtual Host Configs

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;


#mail {

# See sample authentication script at:


# auth_http localhost/auth.php;

# pop3_capabilities “TOP” “USER”;

# imap_capabilities “IMAP4rev1” “UIDPLUS”;

server {

listen localhost:110;

protocol pop3;

proxy on;


server {

listen localhost:143;

protocol imap;

proxy on;



Do you currently have a virtual host for that site that works in HTTP, or do you just have the domain name pointed at the server without any specific related server configuration yet?

http is already setup and working now.

Did you edit any file to make that happen? Perhaps in /etc/nginx/sites-available?

This is an issue with our nginx plugin - it won’t do a challenge unless you have a server_name set in your virtual host that matches the one that you specify on the command line.
We’re going to fix this:
But for now you should just add a server_name directive that mentions the domain you want a cert for.

Where do I add a server_name directive and what form should it be in?

Figured that out:

server {
listen 443 default_server;

    # SSL configuration
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    # include snippets/snakeoil.conf;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;

server_name _;


    location / {
            # First attempt to serve request as file, then
            # as directory, then fall back to displaying a 404.
            try_files $uri $uri/ =404;


I seem to have gotten further.

Which names would you like to activate HTTPS for?


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:
tls-sni-01 challenge for
nginx: [emerg] a duplicate listen in /etc/letsencrypt/le_tls_sni_01_cert_challenge.conf:1
Cleaning up challenges
nginx restart failed:

Got it!

SwartzCrCertbot had the answer. And I had the 443 line incorrectly delimitered also.

Thanks for the help and thanks for your efforts, schoen.

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