From 45764672063f92dba2040bf4e74424352888b06d Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Mon, 20 May 2019 11:26:54 +0200
Subject: [PATCH] Change default for alias_redirect to false and handle it for
 HaProxy too

---
 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 201dda9..4bb8cb9 100644
--- a/templates/haproxy_cfg.jinja2
+++ b/templates/haproxy_cfg.jinja2
@@ -121,7 +121,7 @@ frontend http_in
 {% if proxy_redirect_aliase %}
 {% for drupal in hostvars[host].drupal_settings|default([]) %}
 {% for domain in drupal.domains|default([]) %}
-{% if not domain.multidomain|default(false) %}
+{% if not domain.multidomain|default(false) and domain.aliases_redirect|default(true) %}
 {% for alias in domain.aliases|default([]) %}
   redirect prefix {{ domain.protocol|default('https') }}://{{domain.domain}} code 301 if !letsencrypt_challenge { hdr(host) -i -n {{alias}} }
 {% endfor %}
@@ -263,7 +263,7 @@ frontend https_in_{{ cert.ip }}
 {% if proxy_redirect_aliase %}
 {% for drupal in hostvars[host].drupal_settings|default([]) %}
 {% for domain in drupal.domains|default([]) %}
-{% if not domain.multidomain|default(false) %}
+{% if not domain.multidomain|default(false) and domain.aliases_redirect|default(true) %}
 {% for alias in domain.aliases|default([]) %}
   redirect prefix {{ domain.protocol|default('https') }}://{{domain.domain}} code 301 if { hdr(host) -i -n {{alias}} }
 {% endfor %}
-- 
GitLab