On 24-04-2012 01:31, David Birdsong wrote:
On Mon, Apr 23, 2012 at 2:48 PM, Kevin Heatwole <ke...@heatwoles.us>
You might want to block the IPs before they get into haproxy.
Maybe put an nginx reverse proxy in front of haproxy?
I use nginx to dynamically block/allow HTTP requests by IP.
Another possibility, if you just need to block a list of IPs would
use a firewall/iptables in front of haproxy to do the blocking.
- nginx is already in front of haproxy, but nginx is not the first
listener, so it sees the IP addresses as HTTP headers too. the last
time I checked nginx only blocks IP addresses from layer 4
connections. any other blocking would require nginx to compare the IP
addresses as strings or regexes which I want to avoid doing on every
single request. if the list grows long, every request suffers. ip
comparison on long lists of IP's is one area where haproxy is the
Depend on the list size maybe you can use the map module from nginx.
The map module can also handle regex matches.
- iptables won't work either, iptables works on TCP/IP not HTTP
Depend of your iptables setup maybe you can use the string matching
i'd like to keep IP blocking in haproxy.