我following these instructions在运行Nginx和Ubuntu 14.04的DigitalOcean网站上安装Certbot和Let's Encrypt,但是我遇到了麻烦。
当我到达alpha插件部分时:certbot --nginx
我收到以下回复:
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):
我输入我的域名,点击输入并获取:
Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for **MYDOMAINNAME**
Cleaning up challenges
Cannot find a VirtualHost matching domain **MYDOMAINNAME**.
我不确定如何克服此错误。这是我的网站可用服务器块:
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
}
}
我出错的任何想法?
答案 0 :(得分:1)
您没有MYDOMAINNAME的服务器阻止。
server {
server_name MYDOMAINNAME;
...
}
您可以至少将默认服务器块中的localhost
替换为MYDOMAINNAME
。
答案 1 :(得分:1)
在nginx.conf中添加了一个服务器块,允许该过程完成:
server {
listen 80;
server_name projectapollo.io;
}