Installed (ghost install i.e. not ghost install local - so I have a production config file.) current (4.17.1) version ghost, following this guide, with cli-version 1.17.3, on a raspberrypi4 with current buster OS.
NB: A couple of variations tot he guide were
used node14x
nginx was broken from the start (wouldn’t start with reason nginx: [emerg] open() "/etc/nginx/sites-enabled/default" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62), but I fixed it by commenting out include /etc/nginx/sites-enabled/*; from /etc/nginx/nginx.conf
I know little about the “raspberrypi4 with current buster OS.” I use Nginx with Ubuntu on x86 hardware. Although, Ubuntu and Buster OS are both based on Debian, there could be differences since Buster OS runs on Raspberry hardware.
You’ll need to search: how to create nginx server block buster os rasberry pi
My suggestion is to simply test if nginx actually works by creating a simple index.html test page.
Yeah, no worries - happy to try that. I am just not clear on the steps to go it (assume I am new to all this, as I am.) e.g. i created the file with some text in the /etc/nginx/sites-available folder and then restarted ghost, but that does not appear to have done anything. Where do I create the file? do I need to do anything else, or is that it?
Once you create the server block, you need to enable it. I’m a newbie to Ghost also. Here’s how to do it in Nginx on Ubuntu. Just replace
“user-name” with your Linux username and
“factnest.com” with your domain.
#Enable your NGINX site.
$ sudo ln -s /etc/nginx/sites-available/factnest.com /etc/nginx/sites-enabled/
#Run NGINX’s configuration test to verify your configuration file.
$ sudo nginx -t
#Restart NGINX for the changes to take effect.
$ sudo service nginx restart
Config files
/etc/nginx/sites-available/factnest.com and
/etc/nginx/sites-enabled/factnest.com ARE THE SAME. Change sites-available and the other one changes.
Launch the website with test .html file
make webroot directory, chown, chmod 775 permission
nginx was broken from the start (wouldn’t start with reason nginx: [emerg] open() "/etc/nginx/sites-enabled/default" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62 ), but I fixed it by commenting out include /etc/nginx/sites-enabled/*; from /etc/nginx/nginx.conf
This is a fundamental issue. Your fix will not have resolved the underlying issue. I strongly suspect you will continue to have issues until this is resolved.
The nginx that gets installed in Raspberry Pi OS is not unusual, so I don’t think you should expect anything other than the documented behaviour. An empty sites-available and no sites-enabled/default is very unusual.
You should re-install nginx using sudo apt install nginx. You may need to delete /etc/nginx or ever re-install the OS to ensure your installation is correct.
consider using certbot aka LetsEncrypt directly - this will setup and manage the SSL certs for all Nginx sites on your pi - not just the Ghost ones.
I agree with the above comments - sounds like your initial nginx install borked, as the default site is always used on Debian/Ubuntu to prove the nginx install worked.