1

我正在按照这些说明在运行 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
    }
}

有什么想法我哪里出错了吗?

4

2 回答 2

1

向 nginx.conf 添加了一个服务器块,并允许该过程完成:

server {
listen 80;
server_name projectapollo.io;
}
于 2017-06-01T06:08:41.747 回答
1

您没有 MYDOMAINNAME 的服务器块。

server {
server_name MYDOMAINNAME;
...
}

您至少可以在默认服务器块中localhost替换为。MYDOMAINNAME

于 2017-06-01T05:41:15.290 回答