Disclaimer:
This topic is for HTTP Traffic (on Linux Platform). May be there is a good solution with ELB (with reasonable price for everyone) for the problem below. But so far i can not find any. That's why i need expert advices.
Problem:
I've been using AWS Elastic Load Balancing (ELB) for years. And suddenly realized there is a huge (and critical to me) drawback of ELB .. which is to block the inbound connections by IP.
Because once you are behind ELB(s), your Server Internal Firewalls (like: iptables
) are useless already because all the forwarded traffics from ELB are stamped as ELB IP (not the real Client IP). ELB only forwards the Real Client IP as in X-Forwarded-For
http header, which is useless for iptables
. (Unless you can suggest there is a Linux Firewall like iptables
which can also handle HTTP Traffic with XFF (X-Forwarded-For) header inside.)
I understand this is the normal behaviours of such Reverse Proxies, but i need to put a Firewall! I know on AWS, it is suggested to use VPC and the Network ACL rules to BLOCK the inbound connections by IP. But NACLs have the rule limits! (AWS only allows total of maximum 40 rules in NACLs)
Imagine you are running a high traffic Public website, and then need to block a lot bad IPs detected everyday. How would this 40 rules help?
Need Advice:
I'm start thinking of using Nginx
as the Load-balancer (on a separate Instance). I've used Nginx
before and it is a promising one. And of course, can replace ELB. And then:
- use the
iptables
on thatNginx
Instance! (So, that VM will become LB+Firewall)
But before i make a move,
- Are there any better, expert advices?
- What will be the big difference (impact) of not using ELB here?
Thanks all for advices.