From 622c348449371878d914d10f3ccf52483a354ad7 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Tue, 29 Nov 2016 18:25:14 +0100
Subject: [PATCH] Allow special proxy rules for each host

---
 templates/haproxy_cfg | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/templates/haproxy_cfg b/templates/haproxy_cfg
index 02fa5df..0be95cf 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 %}
-- 
GitLab