Creating Sub Directories with Ghost 1-Click Installation

August 28, 2014 1.6k views

Hi guys,

Beginner Digital Ocean and SSH user here - so I am actively learning about controlling my remote server from Terminal using command prompts (quite a lot of fun).

I am trying to configure my 1 click Ghost installation setup ( so that I can have separate sub directories that will contain static HTML / CSS apps to work on URLs such as and and etc...

These static HTML / CSS apps will be uploaded to these custom sub directories via SFTP - which I can login to using my favorite FTP program.

I have spent the last few days reading through many questions, tutorials, and even lodging a support ticket with Digital Ocean help desk - however, I am unable to get this working properly without encountering 404 errors, or breaking the server configuration files.

From what I have read so far, I need to setup virtual hosts to work with Ghost (the 1 click installation uses nginx).

This is a long shot, however, is anyone able to assist with a step-by-step simplified tutorial by any chance?

Thanks for your help in advance!

FYI - I have already setup a custom domain to point and work with my server.

PS - I have tried the following tutorials below but they cause more confusion than anything else.

1 Answer

If you are using the Ghost one-click install image then do the following.

Edit your nginx configuration that serves your ghost blog /etc/nginx/conf.d/default.conf

Add the following inside of the server block, right after location / { ... }

    location /static {
            root /var/www/ghost;

Then goto your Ghost blog installed directory: /var/www/ghost

There create a new directory, in this case I called it "static".

Put your files, sub-directories or anything else that you want in there.

To access them just goto:

If you want to call it something else, just modify the location block to something other than /static and create the directory to match it.

Now my full /etc/nginx/conf.d/default.conf looks like:

  server {
    listen 80;

    client_max_body_size 10M;
    location / {                                                             
      proxy_pass http://localhost:2368/;                               
      proxy_set_header Host $host;                                     
      proxy_buffering off;                                             

    location /static {
      root /var/www/ghost;

Last but not least ensure that the directory you created and the files inside of it have the correct permissions to ensure that nginx can read them, and you're all set.

Have another answer? Share your knowledge.