Creating Sub Directories with Ghost 1-Click Installation

  • Posted on August 28, 2014
  • cxg945Asked by cxg945

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.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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: etc.

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.