• Resolved Stephen S

    (@ssuess)


    Any tips for getting this to work behind a load balancer? I can see that IPs are being banned properly in the logs, and if someone from one of those IPs connects directly to the machine they will indeed be blocked. But if they are being forwarded from a Load Balancer, they are not blocked.

Viewing 1 replies (of 1 total)
  • Thread Starter Stephen S

    (@ssuess)

    I actually got this working myself, following this guide somewhat: https://www.michelem.org/2014/08/01/nginx-fail2ban-blocking-ip-behind-aws-load-balancer/

    One gotcha is that his script is missing the <ip> sent with the script command, so it should be more something like:

    actionban = <iptables> -I f2b-<name> 1 -s <ip> -j <blocktype>
    			/etc/fail2ban/ban-deny-nginx.sh ban <ip>

    And also, I had to set the IP of my LB for set_real_ip_from in the nginx conf. Other than those issues, it works a treat!

Viewing 1 replies (of 1 total)
  • The topic ‘Behind Load Balancer?’ is closed to new replies.