Reputation: 175
I'm following these instructions to install Certbot and Let's Encrypt on my DigitalOcean site running Nginx and Ubuntu 14.04, but am hitting a snag.
When I get to the alpha plugin portion: certbot --nginx
I get the following response:
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 enter my domain name, hit enter and get:
Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for **MYDOMAINNAME**
Cleaning up challenges
Cannot find a VirtualHost matching domain **MYDOMAINNAME**.
I'm not sure how to get past this error. Here's my sites-available server block:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location ~ /.well-known {
allow all;
root /usr/share/nginx/html;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
}
Any ideas where I'm going wrong?
Upvotes: 1
Views: 1138
Reputation: 175
Added a server block to nginx.conf and that allowed the process to finish:
server {
listen 80;
server_name projectapollo.io;
}
Upvotes: 1
Reputation: 2675
You don't have server block for MYDOMAINNAME.
server {
server_name MYDOMAINNAME;
...
}
You can replace localhost
with MYDOMAINNAME
in the default server block at least.
Upvotes: 1