diff --git a/defaults/main.yml b/defaults/main.yml index 7491f6ba4b7dbfb6c8fbb33698f8cdf633b8a9a2..34796ba16bc9484edcdeb1bfc9419b039bc3cf70 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -85,3 +85,5 @@ proxy_blacklist: - 'exabot' - 'dotbot' - 'gigabot' + other: + - 'path_beg /wp-admin' diff --git a/templates/haproxy_cfg b/templates/haproxy_cfg index a500d1742a0a8f100d1040c567f94bfaab4479dd..ba761a43d2f7c347727ac02a3f3d39cba8bc9527 100644 --- a/templates/haproxy_cfg +++ b/templates/haproxy_cfg @@ -59,6 +59,9 @@ frontend http_in http-request deny if blockedreferer acl blockedagent hdr_sub(user-agent) -i -f /etc/haproxy/blacklist.agent http-request deny if blockedagent +{% for rule in proxy_blacklist.other|default([]) %} + http-request deny if { {{ rule }} } +{% endfor %} {% for host in groups['all'] %} {% for redirect in hostvars[host].proxy_redirect|default([]) %} {% for from in redirect.from %} @@ -119,6 +122,9 @@ frontend https_in_{{ cert.ip }} http-request deny if blockedreferer acl blockedagent hdr_sub(user-agent) -i -f /etc/haproxy/blacklist.agent http-request deny if blockedagent +{% for rule in proxy_blacklist.other|default([]) %} + http-request deny if { {{ rule }} } +{% endfor %} {% for host in groups['all'] %} {% for redirect in hostvars[host].proxy_redirect|default([]) %} {% for from in redirect.from %}