Skip to content

Instantly share code, notes, and snippets.

@sribalakumar
Created June 17, 2020 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sribalakumar/3ec0097e5b3d2f072b9309e80dded96c to your computer and use it in GitHub Desktop.
Save sribalakumar/3ec0097e5b3d2f072b9309e80dded96c to your computer and use it in GitHub Desktop.
# Simple HAProxy config to block ip, domain
acl blacklist_ip hdr_ip(x-forwarded-for,-1), map_ip(blacklisted_ips.lst) -m found
acl blacklist_domain hdr(host), map_str(blacklisted_domains.lst) -m found
http-request deny if is_bad_request or blacklist_ip or blacklist_domain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment