SSL Issue - Website won't start

Hi Everyone,

I was having issues with my previous server so I decided to create a new installation of Ghost and now the site wont work at all. I get an Error 521 error displayed when I try to load the site

My website is at https://susanscorner.club/ and it is using the latest version 3.40.5 with Digital Ocean and Cloudflare. I have setup the www SSL version of the site as well.

After installing both SSL’s, I decided to go edit my conf files in

/etc/ngix/sites-available/

In this folder I see only 3 files, default, susanscorner.club.conf and www.susanscorner.club.confg

I have edited the susanscorner.club.conf as follows:

server {
    listen 80;
    listen [::]:80;

    server_name susanscorner.club;
    root /var/www/ghost/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)

    location / {
            return 301 https://susanscorner.club$request_uri;
    }

    location ~ /.well-known {
        allow all;
    }

    client_max_body_size 50m;
}

And then, I edited www.susanscorner.club.conf as follows - based on the information I found on this forum:

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    ssl_certificate /etc/letsencrypt/www.susanscorner.club/fullchain.cer;
    ssl_certificate_key  /etc/letsencrypt/www.susanscorner.club/www.susanscorner.club.key;
    include /etc/nginx/snippets/ssl-params.conf;

    server_name www.susanscorner.club;
    root /var/www/ghost/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)


    location / {
        return 301 https://susanscorner.club$request_uri;
    }

    location ~ /.well-known {
        allow all;
    }

    client_max_body_size 50m;
}

When I run sudo nginx -t, I get the following error:

nginx: [emerg] open() "/etc/nginx/snippets/ssl-params.conf" failed (2: No such file or directory) in /etc/nginx/sites-enabled/www.susanscorner.club.conf:7
nginx: configuration file /etc/nginx/nginx.conf test failed

I checked the /etc/nginx/snippets/ folder and there doesnt seem to be the ssl-params.conf file in there. I get this might be the main reason for this issue but I’ve been struggling and trying to find this file without any success.

Can someone please help me?

Btw, I did run ghost doctor and ghost ls and everything seems to be working fine. That’s why I’m so confused :frowning:

remove or comment the snippets line something this below

ssl_certificate /etc/letsencrypt/www.susanscorner.club/fullchain.cer;
ssl_certificate_key  /etc/letsencrypt/www.susanscorner.club/www.susanscorner.club.key;
#include /etc/nginx/snippets/ssl-params.conf;

& then run

nginx -t

hope this will solve your issue

Hi,

I did as you said and then I got this error:

nginx: [emerg] cannot load certificate "/etc/letsencrypt/www.susanscorner.club/fullchain.cer": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/www.susanscorner.club/fullchain.cer','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed

I checked the /etc/letsencrypt/www.susanscorner.club folder and it has these files

www.susanscorner.club.conf www.susanscorner.club.csr www.susanscorner.club.csr.conf www.susanscorner.club.key

the file should me in folowing directory

 /etc/letsencrypt/live/www.susanscorner.club/fullchain.pem

can you send a screenshot what files are there?

This is the /etc/letsencrypt folder

whats under susanscorner.club dir?

This