Question

How to Resolve Nginx Error?

Posted June 2, 2021 65 views
Nginx

My website recently crashed. After some digging around on the server, I found Nginx to be at fault.

systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2021-06-02 08:06:58 UTC; 12min ago
Docs: man:nginx(8)
Process: 24165 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

These are the logs

sudo tail -f /var/log/nginx/error.log

2021/06/02 06:03:20 [emerg] 22723#22723: cannot load certificate "/etc/nginx/https/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/https/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)

I tried looking at https://www.digitalocean.com/community/questions/errors-nginx-1-10-3-ubuntu but that didn’t help.

Here are my system specs:
OS: Ubuntu, v20.04.2 LTS
Node Version: v12.20.1
Ghost Version: 3.41.3
Ghost-CLI Version: 1.15.3
Environment: production
Command: ‘ghost doctor’

I would be highly appreciative of any help! Thank you.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
3 answers

So you are setting up a Ghost CMS on the DigitlOcean Droplet.
According to the logs, there is a problem with the path of SSL certificates. So what you can do is completely remove the nginx from you machine and reinstall it. After that use the command ghost setup Nginx and it will set up the Nginx again for your Ghost CMS.

OR

Go to the /etc/ssl and find the certificates in the SSL directory. According to me, the certs file should be there. If you find them then update the path of certs in the Nginx config file which is in the sites-enabled folder.

Proper formatting of code snippets above.

sk@samanvayblog:/var/www/website$ systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2021-06-02 08:06:58 UTC; 12min ago
       Docs: man:nginx(8)
    Process: 24165 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

sk@samanvayblog:/var/www/website$ sudo tail -f /var/log/nginx/error.log
2021/06/02 06:03:20 [emerg] 22723#22723: cannot load certificate "/etc/nginx/https/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/https/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
Debug Information:
    OS: Ubuntu, v20.04.2 LTS
    Node Version: v12.20.1
    Ghost Version: 3.41.3
    Ghost-CLI Version: 1.15.3
    Environment: production
    Command: 'ghost doctor'

For the record, my SSL is set up using

ghost setup ssl
SSL has already been set up, skipping
ℹ Setting up SSL [skipped]