0

I am using CentOS 7, Nginx 1.12.2, certbot 0.31.0 ,

Error after delete all things related to Let's Encrypt of 002.bkit.vn

[root@VMHostDefault 002.bkit.vn]# nginx -t
nginx: [emerg] BIO_new_file("/etc/letsencrypt/live/002.bkit.vn/fullchain.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/002.bkit.vn/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed

A few information may be helpful

[root@VMHostDefault 002.bkit.vn]# certbot --version
certbot 0.31.0
[root@VMHostDefault 002.bkit.vn]# nginx -v
nginx version: nginx/1.12.2
[root@VMHostDefault 002.bkit.vn]# certbot delete --cert-name 002.bkit.vn
Saving debug log to /var/log/letsencrypt/letsencrypt.log
No certificate found with name 002.bkit.vn (expected /etc/letsencrypt/renewal/002.bkit.vn.conf).
[root@VMHostDefault 002.bkit.vn]# nginx -t
nginx: [emerg] BIO_new_file("/etc/letsencrypt/live/002.bkit.vn/fullchain.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/002.bkit.vn/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed
[root@VMHostDefault 002.bkit.vn]# 

I want to remove all thing related to site http://002.bkit.vn How to fix that?

0

As the error message indicates, the configuration file used by nginx is /etc/nginx/nginx.conf. If you open up that file, you should see a server block similar to this:

server {
    listen ...
    server_name ...
    ...
    ssl_certificate     /etc/letsencrypt/live/002.bkit.vn/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/002.bkit.vn/fullchain.key;
    ....
}

Basically, you're looking for the server block that is defined for the site 002.bkit.vn. If you want to remove the entire site from being served, remove this server block from the configuration file.

Once that's done, you'll need to reload the nginx process for the changes to take effect. The command to do this is nginx -s reload. If you're using a systemd service instead, the command will be systemctl reload nginx.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.