Host ghost blog as a subdirectory, but on another droplet

Posted February 23, 2016 5.7k views


I’m a dev. , and pretty new to managing servers.

I have a Meteor application running on a droplet, at the following address :

I was wondering if I can have a URL like the following one for my blog :

Without hosting the ghost blog on the same droplet as the Meteor app, i.e having a nginx config to host a ghost blog on another droplet but act as if it was a subdirectory of my main app.

Is this possible ? Or do I have to host the blog as a subdirectory of my main app on the same droplet ?

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.

Submit an Answer
2 answers

Yes, it’s definitely possible! As you can only point the domain to one server with DNS, you’ll need to employ an Nginx proxy pass in order to route requests to the correct Droplet. If you haven’t done so already, you will need to set up your Meteor app to run behind Nginx. For more information, check out:

After doing so, you can now add a new location block to your Nginx configuration that proxies requests to blog/ to your Droplet running Ghost. It should look something like this:

        location /blog {
                proxy_pass http://ghost.droplet.ip:port;
                proxy_redirect off;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Make sure to replace ghost.droplet.ip with the IP address of the Droplet running your Ghost blog. If it isn’t running on port 80, specify the port as well. Next, restart Nginx for the changes to take effect:

  • sudo service nginx restart

On the Ghost Droplet, you’ll also need to update Ghost’s config.js so that it knows it is running from a subdirectory and will server the correct URL. Find the url setting and add the trailing /blog like so:

    production: {
        url: '',

Hope that points you in the right direction! Let us know if you run into any issues.

by Daniel Speichert
Deploy a Meteor.js application on Ubuntu 14.04 with Nginx and MongoDB. This tutorial shows you how to build and deploy a production-ready version of your JavaScript application using the Meteor framework.

Hello @MaxenceC ,

Would you mind sharing your configuration? I did not seem to make it work following the above provided steps.

On the Ghost blog droplet, what was configured on the nginx file along with your SSL ? Are both droplets on the same domain or what subdomain to use for the Ghost blog droplet ?