diff --git a/templates/haproxy_cfg b/templates/haproxy_cfg
index 02fa5dfca7f2bd40b812e502a7dc80b3f96cb549..0be95cfdb365bc9fb3155fefe8f2aef54cf12ffa 100644
--- a/templates/haproxy_cfg
+++ b/templates/haproxy_cfg
@@ -125,6 +125,10 @@ frontend http_in
   acl domain_in_{{host}} hdr(host) -i -n -f /etc/haproxy/{{host}}.list
   use_backend backend_{{host}}_bigpipe if domain_uses_bigpipe domain_in_{{host}}
   use_backend backend_{{host}} if domain_in_{{host}}
+{% for rule in hostvars[host].proxy_special_rules|default([]) %}
+  acl proxy_special_rules_{{host}}_{{rule}} {{ hostvars[host].proxy_special_rules[rule] }}
+  use_backend backend_{{host}} if proxy_special_rules_{{host}}_{{rule}}
+{% endfor %}
 {% if hostvars[host].proxy_crm_domains is defined %}
   acl crm_domain_in_{{host}} hdr_dom(host) -i -n -f /etc/haproxy/{{host}}.crm.list
   use_backend backend_{{host}} if crm_domain_in_{{host}}
@@ -209,6 +213,10 @@ frontend https_in_{{ cert.ip }}
   use_backend backend_{{host}}_https if ssl_domain_in_{{host}}
   acl redirect_{{host}} hdr(host) -i -n -f /etc/haproxy/{{host}}.list
   use_backend backend_redirect if redirect_{{host}}
+{% for rule in hostvars[host].proxy_special_rules|default([]) %}
+  acl proxy_special_rules_{{host}}_{{rule}} {{ hostvars[host].proxy_special_rules[rule] }}
+  use_backend backend_{{host}}_https if proxy_special_rules_{{host}}_{{rule}}
+{% endfor %}
 {% if hostvars[host].proxy_crm_domains is defined %}
 {% endif %}
 {% endfor %}