2

I wanted to delete my Certbot SSL, I ran "sudo certbot delete" and did it. After when restarting nginx, it gave me this error:

nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/fishymine.xyz/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/fishymine.xyz/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file).

How do I fix this?

2
  • 1
    What did you expect? You deleted the certificate. Now Nginx is reporting an error that it cannot open the certificate file. Commented Aug 26, 2021 at 23:58
  • 1
    Yes I know, but shouldn't it make it like when I started nginx for the first time? Commented Aug 27, 2021 at 13:23

1 Answer 1

1

The problem is that certbot automatically insert config rules when you add a certificate. All of the inserted lines includes "Cerbot" so you can do this to remove these lines :

sudo sed -i '/Certbot/d' /etc/nginx/sites-available/*
sudo sed -i '/Certbot/d' /etc/nginx/sites-enabled/*

then try

sudo nginx -t
sudo certbot --nginx

if you still get an error, you can check the files in /etc/nginx/sites-* manually, or just delete their content if you don't care about the existing config by :

sudo chmod 777 /etc/nginx/sites-enabled/default
sudo echo '' > /etc/nginx/sites-enabled/default
sudo chmod 644 /etc/nginx/sites-enabled/default

sudo chmod 777 /etc/nginx/sites-available/default
sudo echo '' > /etc/nginx/sites-available/default
sudo chmod 644 /etc/nginx/sites-available/default
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.