How to Resolve Nginx Error?

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

systemctl status nginx

     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 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. 

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.


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.

-> then answer is in the code ;)
No such file or directory:fopen('/etc/nginx/https/fullchain.pem (the file with chain is not at the place it is supposed to be)

For the record, my SSL is set up using

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