gpt4 book ai didi

Nginx:删除证书后 [emerg] 无法加载证书

转载 作者:行者123 更新时间:2023-12-04 22:39:35 24 4
gpt4 key购买 nike

我在我的一个子域上生成了 SSL 证书。然后我尝试 delete/revoke证书使用命令certbot delete .弹出一个小终端菜单,询问我要删除什么证书。我删除了我想删除的那个。现在,当运行 sudo nginx -t我收到错误消息说:nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/app.mydomain.nl/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory我猜 certbot delete命令没有完全删除证书还是什么?我现在不知道该怎么办...

最佳答案

您可能使用了命令 $ certbot --nginx并且您的 nginx 配置文件已被编辑以查找证书:

server{
server_name [your_domain];

location /static {
...
}

location / {
...
}

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/[...]; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/[...]; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/[...]; # managed by Certbot

}

server{
if ($host = [your_domain]) {
return 301 https://$host$request_uri;
} # managed by Certbot


server_name [your_domain];
listen 80;
return 404; # managed by Certbot

}
$ certbot delete不会改回来,所以你必须删除与证书相关的部分并更改 server_name到你的IP地址,所以它看起来像:
server{
server_name [your ip];

location /static {
...
}

location / {
...
}

}

关于Nginx:删除证书后 [emerg] 无法加载证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71730055/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com