The firewall blocks all my requests

November 4, 2019 104 views
Firewall

I have two droplets. The first is used for my frontend app and the second is used for my backend.
I want to restrict my backend to my frontend but i cannot.
I tried many way but not succes.
I follow this tutorial -firewallsExample link
My backend droplet restrict all requests

Thanks in advance.

1 comment
2 Answers

Hi @dmm2019,

If you wish for your frontend app to connect to your backend app, all you’ll need to do is allow all connections from the frontend droplet. The exact command is

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

Just replace the XXX.XXX.XXX.XXX with your droplet’s IP address.

Regards,
KDSys

Hi @KDSys ,

Thanks you for your response.
I forgot to say that my backend use Docker-compose.
I allow all conections from frontend droplet but i want to restrict my backend droplet to my frontend droplet or my own network.
I use nginx and Docker for my backend.

Thanks you

Have another answer? Share your knowledge.