Adding seperate pages to Ghost installation

I saw this on The Next Web. I wanted one too. However, Ghost doesn't make it easy to add a custom page. It automatically rewrites any subdirectory pages I attempt to add and reach with its own pathing system. I'm working on a Digital Ocean Dropplet so that means a Nginx server. For those who also want to add seperate entities to their Ghost website, hopefully this helps.

Platform:

  • Nginx
  • Ghost
  • linux

With a directory tree of:

/var/www
	-ghost
    -startpage

Find the nginx config files. Specifically, the config for your website.
I do NOT claim any real understanding of this code. Just that it works for me.

Mine was

/etc/nginx/sites-available

The sites-enabled directory is a symbolic link to the file located inside of sites-abailable but I believe that editing the original should be safest and reduce risk of accidentally doing something you don't intend.

Add the code below, but changed to fit your specific directory that you want. Here, I want to serve endqwerty.com/startpage using the startpage directory.

location /startpage {
        autoindex on;
        root /var/www;
    }

It should be included below:

location / {
...
}

and before the final closing bracket for:

server {
...
!!!INCLUDE HERE!!!
}

Now you need to run the following in console:

nginx -s reload

This will refresh your server and reload the configuration files. Try out your page now. If it works you're all done. If not, check out some Nginx help pages. Hopefully, they'll shed some light or send me an email at value@endqwerty.com.