Stevie-Ray / referrer-spam-blocker

Apache, Nginx, IIS, uWSGI, Caddy & Varnish blacklist + Google Analytics segments to prevent referrer spam traffic 🤖
MIT License
374 stars 86 forks source link

Integration with HAProxy #117

Closed julianxhokaxhiu closed 7 years ago

julianxhokaxhiu commented 7 years ago

Hi,

can you please add HAProxy support? You just need to output a config file that is valid for HAProxy acl -f feature. See https://www.haproxy.com/doc/aloha/7.0/haproxy/acls.html#acl-f-flag

Thank you in advance, Julian


Example of usage:

acl invalid_referer hdr_sub(referer) -i -f /etc/haproxy/banned.haproxy.conf
block if invalid_referer
Stevie-Ray commented 7 years ago

Hi Julian! Can you tell me how to write a valid HAProxy config file?

julianxhokaxhiu commented 7 years ago

Sorry I forgot to reply back. At the current status I didn't found an example to show, I will see if I can build up something this weekend.

yitzhaq commented 1 year ago

Please consider reopening this issue. The format is trivial, it's just one domain per line:

foo.com bar.com

etc.

The only additional config required to use with HAProxy is what was already pasted in the example in the original report.

Having a file in this format available from the repo would be hugely useful, not just for HAProxy, but for anything from which someone might want to generate a custom list.

Thanks for your consideration.

Stevie-Ray commented 1 year ago

hi @yitzhaq please create a PR for HAProxy and i'll happily merge it.

yitzhaq commented 1 year ago

hi @yitzhaq please create a PR for HAProxy and i'll happily merge it.

Done