From ad731207c5d90a0437e14948345f58eda9f08d2f Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Mon, 23 Jul 2018 18:53:41 +0200
Subject: [PATCH] Make sure map comparisons are not-case-sensitive

---
 templates/haproxy_cfg.jinja2 | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/templates/haproxy_cfg.jinja2 b/templates/haproxy_cfg.jinja2
index 06d42c4..1d98090 100644
--- a/templates/haproxy_cfg.jinja2
+++ b/templates/haproxy_cfg.jinja2
@@ -71,10 +71,10 @@ frontend http_in
 {% endfor %}
   http-request set-header x-routing-host undefined
   acl letsencrypt_challenge path_beg /.well-known/acme-challenge/
-  http-request redirect code 301 location %[base,map(/etc/haproxy/redirect.domain-and-path.map)] if !letsencrypt_challenge { base,map(/etc/haproxy/redirect.domain-and-path.map) -m found }
-  http-request redirect code 301 location %[capture.req.uri,map(/etc/haproxy/redirect.path.map)] if !letsencrypt_challenge { capture.req.uri,map(/etc/haproxy/redirect.path.map) -m found }
-  http-request redirect code 301 location %[hdr(host),map(/etc/haproxy/redirect.domain.map)] if !letsencrypt_challenge { hdr(host),map(/etc/haproxy/redirect.domain.map) -m found }
-  http-request redirect code 301 location %[hdr(host),map(/etc/haproxy/redirect.domain-append-path.map)]%[capture.req.uri] if !letsencrypt_challenge { hdr(host),map(/etc/haproxy/redirect.domain-append-path.map) -m found }
+  http-request redirect code 301 location %[base,lower,map(/etc/haproxy/redirect.domain-and-path.map)] if !letsencrypt_challenge { base,lower,map(/etc/haproxy/redirect.domain-and-path.map) -m found }
+  http-request redirect code 301 location %[capture.req.uri,lower,map(/etc/haproxy/redirect.path.map)] if !letsencrypt_challenge { capture.req.uri,lower,map(/etc/haproxy/redirect.path.map) -m found }
+  http-request redirect code 301 location %[hdr(host),lower,map(/etc/haproxy/redirect.domain.map)] if !letsencrypt_challenge { hdr(host),lower,map(/etc/haproxy/redirect.domain.map) -m found }
+  http-request redirect code 301 location %[hdr(host),lower,map(/etc/haproxy/redirect.domain-append-path.map)]%[capture.req.uri] if !letsencrypt_challenge { hdr(host),lower,map(/etc/haproxy/redirect.domain-append-path.map) -m found }
 {% if haproxy_private is defined %}
 {% if haproxy_private.domain is defined %}
   acl privatedomain hdr(host) -i -n -f /etc/haproxy/privatelist.domain
@@ -195,10 +195,10 @@ frontend http_in
 frontend https_in_{{ cert.ip }}
   bind {{ cert.ip }}:443 ssl crt /etc/haproxy/certs/{{ cert.file }} no-sslv3
   http-request del-header Proxy
-  http-request redirect code 301 location %[base,map(/etc/haproxy/redirect.domain-and-path.map)] if { base,map(/etc/haproxy/redirect.domain-and-path.map) -m found }
-  http-request redirect code 301 location %[capture.req.uri,map(/etc/haproxy/redirect.path.map)] if { capture.req.uri,map(/etc/haproxy/redirect.path.map) -m found }
-  http-request redirect code 301 location %[hdr(host),map(/etc/haproxy/redirect.domain.map)] if { hdr(host),map(/etc/haproxy/redirect.domain.map) -m found }
-  http-request redirect code 301 location %[hdr(host),map(/etc/haproxy/redirect.domain-append-path.map)]%[capture.req.uri] if { hdr(host),map(/etc/haproxy/redirect.domain-append-path.map) -m found }
+  http-request redirect code 301 location %[base,lower,map(/etc/haproxy/redirect.domain-and-path.map)] if { base,lower,map(/etc/haproxy/redirect.domain-and-path.map) -m found }
+  http-request redirect code 301 location %[capture.req.uri,lower,map(/etc/haproxy/redirect.path.map)] if { capture.req.uri,lower,map(/etc/haproxy/redirect.path.map) -m found }
+  http-request redirect code 301 location %[hdr(host),lower,map(/etc/haproxy/redirect.domain.map)] if { hdr(host),lower,map(/etc/haproxy/redirect.domain.map) -m found }
+  http-request redirect code 301 location %[hdr(host),lower,map(/etc/haproxy/redirect.domain-append-path.map)]%[capture.req.uri] if { hdr(host),lower,map(/etc/haproxy/redirect.domain-append-path.map) -m found }
 {% if haproxy_private is defined %}
 {% if haproxy_private.domain is defined %}
   acl privatedomain hdr(host) -i -n -f /etc/haproxy/privatelist.domain
-- 
GitLab