CliError : Failed to restart Nginx , for setup nginx ssl

I tried to set up a SSL for a subdomain (www) and redirect to
I followed the documentation

I already set an A record for www, pointing to the site host.

After I ran $ ghost setup nginx ssl I got

✖ Setting up SSL
One or more errors occurred.

1) CliError

Message: Failed to restart Nginx.

Debug Information:
    OS: Ubuntu, v22.04.1 LTS
    Node Version: v16.17.0
    Ghost Version: 5.43.0
    Ghost-CLI Version: 1.24.0
    Environment: production
    Command: 'ghost setup nginx ssl'

I checked on /etc/nginx/sites-available and found both .com.conf and .com-ssl.conf for my subdomain that I just configed.
I edited both as instructed .
When I ran sudo nginx-t, I got

nginx: [emerg] cannot load certificate "/etc/letsencrypt/": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/letsencrypt/, r) error:10000080:BIO routines::no such file)

I don’t know if I should delete these two new conf for my subdomain and retry ghost setup nginx ssl, or how should I fix this as my site now working only with and not with www.

Thank you for your time and support.
Please help!

Issue Fixed…
Thank you.

how did you fix it ?
how did you fix it ?

It failed to restart Nginx because the folder /etc/letsencrypt/ couldn’t be found.
In my case, letsencrypt generated certificate under a folder name www.mydomain.com_ecc instead of .
So I went to update the file path in under /etc/nginx/sites-available to

ssl_certificate /etc/letsencrypt/www.mydomain.com_ecc/fullchain.cer;
ssl_certificate_key /etc/letsencrypt/www.mydomain.com_ecc/;

And then $ sudo nginx -t to test and if it works $ sudo nginx -s reload
I have to wait for a minute to successfully reload the nginx as it might need a little time to propagate.

Hope it helps.