How do I connect Nginx, MySQL and Ghost remotely?

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.


Submit an 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.

Hello @si722752, did you find the solution? I have the same homework

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