How do I connect Nginx, MySQL and Ghost remotely?

October 29, 2019 129 views
Nginx Ghost MySQL

Hey. So I have to do the following activity for class: create three droplets, one with MySQL, other with Nginx and the next one with Ghost installed. I have to be able to connect them in orden to Ghost to run properly, but I’m not really sure how to do it. I’ve searched for tutorials around the community and I cannot seem to find anything that works for my particular case. If you have a solution/tutorial for this thing, I will really much appreciate it.

1 Answer

Hi @si722752,

Firstly, I want to say that I’m not sure if having Ghost and Nginx separate will work properly but on to the question.

I assume you’ll be using their public IP addresses. One thing you can do is, allow all traffic from each IP address on each server.

For example, on your MySQL droplet, you’ll need to allow connections from your Nginx and Ghost droplet and the other way around. To do so, you can use the following command

iptables -I INPUT -p tcp -s XXX.XXX.XXX.XXX -j ACCEPT
iptables -I OUTPUT -p tcp -d  XXX.XXX.XXX.XXX -j ACCEPT`

As for the how to make Ghost use Nginx, maybe someone else can pitch in and give an idea.

Regards,
KDSys

Have another answer? Share your knowledge.