Report this

What is the reason for this report?

Install Ghost Manually on a subdomain.

Posted on January 6, 2015

I’m having a hard time installing ghost on my droplet. The guides I found online seems to be missing something.

My droplet run ubuntu 14.04 LTS. I want to run ghost on a subdomain (blog.example.com) . I used the guide to here to add subdomains on nginx and got it working. I followed this guide http://www.howtoinstallghost.com/how-to-install-ghost-on-ubuntu-server-12-04/ until the part “configure ghost” . I changed the config.example.js file adding on the url “blog.example.com” but I left the host untouched.

Can anyone find me a guide that helps me install ghost on a subdomain using nginx that guide us through the whole process until it is working on port 80?



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!

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.

Setting up Ghost to run on a subdomain behind an Nginx reverse proxy shouldn’t be much different than setting it up normally. The key is to set the server_name directive in your Nginx configuration file.

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    server_name blog.example.com

    root /usr/share/nginx/html;
    index index.html index.htm;

    client_max_body_size 10G;

    location / {
        proxy_pass http://localhost:2368;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;
    } 
}

You’ll also need to setup a DNS record pointing the subdomain to the server.

For all the details on setting Ghost up with Nginx, check out this tutorial:

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.