Hello,
I’m a bit new and I apologize if this question was already asked and answered just couldn’t find the answer I was looking for or maybe didn’t understand it correctly but here it goes:
I have a HAProxy set up with two web host behind the load balancer. Both web host have a public and private interface (eth0 public and eth1 private)
I wanted to know how may I set up some rules in IPTable to block incoming connections on port 80 for those host and ONLY have them interact with the haproxy host via the private network? So basically, I want ALL incoming traffic on port 80 blocked on the public interface and all traffic processed via the private interface.
I read a few things but couldn’t get the concept down. Thank you in advance for any and all help!!!
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!
If you’re on apache this can be done really easily with ufw instead of iptables directly.
sudo ufw deny http
sudo ufw allow from allowed ip address to any port 80
This will simply
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.