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 (www.example.com) so that I can have separate sub directories that will contain static HTML / CSS apps to work on URLs such as www.example.com/app01 and www.example.com/app02 and www.example.com/app03 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.
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!
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: http://my-ghost-blog.com/static/file1 http://my-ghost-blog.com/static/subdir1 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;
server_name my-ghost-blog.com;
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.