Where does nginx define the root folder of ghost cms?

Hi There,

Can anyone tell me where does the root folder of Ghost is define in nginx?
as even when I comment the root directive and restart nginx, Ghost is still working :thinking:

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

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

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

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;

    location ~ /.well-known {
        allow all;
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
    client_max_body_size 50m;
  • Ghost version?
    4.34.3 on Linux

Thanks for your help,

What are you trying to do? Your question seems to conflict with the statement that Ghost is still working :wink:

Thanks for your reply.

Well, I try to understand how it works and make my head around. When I use a software (mainly web apps) I like to understand how it works.
Where does Nginx find the instruction to redirect all traffic from mysite.com to
/var/www/mysite/system/nginx-root (which I’m not even sure that this is the public root directory of Ghost as this folder is empty right now).
It have to be define some where…

PS: I already browse the documentation and didn’t find the info.
PS2: This is the first time that I setup a JS web site. All sites that I put in production before were in PHP.

Respond to requests for mysite.com.

For any requests coming in on /*, proxy that request to the Ghost server running on

There’s no β€œroot folder” as such that you’d see in the typical serving-files-directly setup.

1 Like

Ok thank you so much for your help.
So now I start to understand. :smiling_face:
Ghost is setup as a nodeJS server on port 2368 which is used by nginx as a proxy.

And now I can list my ghost site using ghost ls

β”‚ Name                β”‚ Location                     β”‚ Version β”‚ Status               β”‚ URL                         β”‚ Port β”‚ Process Manager β”‚
β”‚ mysite-com          β”‚ /var/www/mysite.com          β”‚ 4.34.3  β”‚ running (production) β”‚ https://mysite.com          β”‚ 2368 β”‚ systemd         β”‚

And now I get the root folder of my ghost site

I can change the target using:
ghost config [key] [value]
ghost config Location \var\www\otherFolder

Is this right?