Question

The firewall blocks all my requests

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.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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

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