配置TSL证书报错Problem in /www/server/panel/vhost/nginx/huidatech.com.conf: tried to insert directive

说明一下,因为需要扩展一个域名,所以需要重新配置SSL证书:

  1. 执行 sudo certbot --nginx

2.报错提示:
Problem in /www/server/panel/vhost/nginx/huidatech.com.conf: tried to insert directive "['ssl_certificate', '/var/lib/letsencrypt/snakeoil/0002_cert.pem']" but found conflicting "['ssl_certificate', '/etc/letsencrypt/live/www.huidatech.com/fullchain.pem']".

3.删除冲突文件/etc/letsencrypt/live/http://www.huidatech.com/fullchain.pem 也不行,请大家帮帮忙,谢谢!

huidatech.com.conf 配置文件配了几个证书?

 access_log  /www/wwwlogs/huidatech.com.log;
    error_log  /www/wwwlogs/huidatech.com.error.log; # managed by Certbot # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/www.huidatech.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/www.huidatech.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot