From 7be941f615a1f6652dc28e8797eaf71136e162dd Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Tue, 9 Feb 2021 15:32:01 +0100
Subject: [PATCH] ansible-inventories/gentner#2370 Redirects based global
 search and replace now require an explicit match argument which may be
 different from the search

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

diff --git a/templates/haproxy_cfg.jinja2 b/templates/haproxy_cfg.jinja2
index 7b2a66c..b7bada6 100644
--- a/templates/haproxy_cfg.jinja2
+++ b/templates/haproxy_cfg.jinja2
@@ -82,7 +82,7 @@ frontend http_in
   http-request auth realm notprivate if !letsencrypt_challenge privatedomain !privateip !private_auth
 {% endif %}
 {% for redirect in proxy_redirect_search_replace|default([]) %}
-  http-request redirect code 301 location %[url,regsub(\"{{ redirect.search }}\",\"{{ redirect.replace }}\",i)] if !letsencrypt_challenge { path_reg {{ redirect.search }} }
+  http-request redirect code 301 location %[url,regsub(\"{{ redirect.search }}\",\"{{ redirect.replace }}\",i)] if !letsencrypt_challenge { path_reg {{ redirect.match }} }
 {% endfor %}
 {% for line in proxy_extra_lines|default([]) %}
   {{ line }}
@@ -221,7 +221,7 @@ frontend https_in_{{ cert.ip }}
   http-request auth realm notprivate if privatedomain !privateip !private_auth
 {% endif %}
 {% for redirect in proxy_redirect_search_replace|default([]) %}
-  http-request redirect code 301 location %[url,regsub(\"{{ redirect.search }}\",\"{{ redirect.replace }}\",i)] if { path_reg ^/{{ redirect.search }} }
+  http-request redirect code 301 location %[url,regsub(\"{{ redirect.search }}\",\"{{ redirect.replace }}\",i)] if { path_reg ^/{{ redirect.match }} }
 {% endfor %}
 {% for line in proxy_extra_lines|default([]) %}
   {{ line }}
-- 
GitLab