Ghost Blog Setup different droplet

January 5, 2019 428 views
Ghost Nginx Ubuntu 16.04

Hey DO Community,

Current setup

Droplet 1 - Main Site.
Droplet 2 - Blog running Ghost.

Issue

I want to be able to point my domain (currently pointing at Droplet 1 the main droplet) to my second droplet that is running the Ghost Blog with the following url

(Domain and IP’s hidden for security purposes)

www.domain.com/blog

Current Config’s

Droplet 1 - Main Config

I have added the following to my NGINX config;

location /blog {
proxypass http://(ip of ghost droplet):80;
proxy
redirect off;
proxysetheader Host $host;
proxysetheader X-Real-IP $remoteaddr;
proxy
setheader X-Forwarded-For $proxyaddxforwarded_for;
}

Droplet 2 - Ghost Config

“url”: “http://www.domain.com/blog”,
“server”: {
“port”: 2368,
“host”: “127.0.0.1”
},

However, when I am now going to www.domain.com/blog - I am getting a 404.

Whenever I go to the ip for the ghost install I am getting a message; 502 Bad Gateway - Am I missing something?

J

Be the first one to answer this question.