Location of service and nginx files

I have 2 blogs hosted on my server and both are running Ghost 4.48.2. I have ghost-cli 1.21.0 installed. Lets call the 2 blogs “Old” and “New”. Both of these are running behind nginx with SSL. But today I noticed that old/system/files has 3 files, a .service file which is symlinked from /lib/systemd/system and 2 nginx .conf files which are symlinked from /etc/nginx/sites-available`.

But I don’t see these files in my New blog. Even the files folder is not present in the new/system folder. Instead the Nginx config files are directly created in sites-available and the service file is directly created in the systemd location.

I tried removing the nginx conf files from the sites-available folder and recreating them for my New blog using the ghost setup nginx command but it just recreated the files in that exact location. I haven’t tried doing the same for my Old blog.

Looking at the cli source code makes me think that the behaviour shown in the Old blog should be the correct one. What exactly is going on here?

P.S. Stuff is working, nothing is broken. This is just a professional curiosity.

The current Ghost CLI behavior is to symlink a Nginx file into sites-available, but that step could be skipped if Nginx is already set up.

A systemd file is created directly in /lib/systemd/system from a template.

1 Like

Do you mean that in the current behaviour, the file in sites-available is symlinked from somewhere else or is the file in sites-available a normal file?

Cause if the file in sites-available is symlinked from somewhere, where is it symlinked from? Moreover, this is not the behaviour that I see.

From reading the source code, there is a template for an Nginx config file stored within the Ghost CLI project.

That template gets rendered into a file stored in sites-available, and then the file in sites-available is symlinked into sites-enabled.

Here’s that piece of code:

1 Like