Certbot安装在nginx上不起作用

Certbot安装在nginx上不起作用,nginx,ssl-certificate,nginx-reverse-proxy,certbot,Nginx,Ssl Certificate,Nginx Reverse Proxy,Certbot,我正在尝试在我的子域上安装带有certbot的证书。 它说在我的nginx配置中没有server\u name指令,但我有,我做了nginx-t,它说配置没有问题 这是certbot的命令行输出 Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator nginx, Installer nginx No names were found in your

我正在尝试在我的子域上安装带有certbot的证书。 它说在我的nginx配置中没有server\u name指令,但我有,我做了nginx-t,它说配置没有问题

这是certbot的命令行输出

    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Plugins selected: Authenticator nginx, Installer nginx
    No names were found in your configuration files. Please enter in your domain
    name(s) (comma and/or space separated)  (Enter 'c' to cancel): subdomain.website.com
    Attempting to parse the version 1.9.0 renewal configuration file found at /etc/letsencrypt/renewal/website.com.
    conf with version 0.40.0 of Certbot. This might not work.
    Cert not yet due for renewal

    You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.

    What would you like to do?
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    1: Attempt to reinstall this existing certificate
    2: Renew & replace the cert (limit ~5 per 7 days)
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
    Keeping the existing certificate
    Could not automatically find a matching server block for subdomain.website.com. Set the `server_name` directive to use the Nginx installer.

    IMPORTANT NOTES:
     - Unable to install the certificate
     - Congratulations! Your certificate and chain have been saved at:
       /etc/letsencrypt/live/subdomain.website.com/fullchain.pem
       Your key file has been saved at:
       /etc/letsencrypt/live/subdomain.website.com/privkey.pem
       Your cert will expire on 2021-01-01. To obtain a new or tweaked
       version of this certificate in the future, simply run certbot again
       with the "certonly" option. To non-interactively renew *all* of
       your certificates, run "certbot renew"
这是我的nginx配置

server {
        listen 80;
        root /var/www/html;
        index index.html;

        server_name website.com www.website.com;

        location / {
                try_files $uri =404;
        }

error_log /var/log/nginx/website.com/error.log;
}

server {
        listen 80;
        server_name subdomain.website.com;
        location / {
                proxy_pass      http://localhost:3000;
        }
}

请提供更多的信息,你到目前为止做了什么。您使用了哪个命令?certbot--nginx