From 956f37ac0672aa3d9429a27157b42ebf6bf2007f Mon Sep 17 00:00:00 2001 From: Philip Henning Date: Sat, 8 Jun 2019 20:15:21 +0200 Subject: [PATCH] Add check if catch-all ("_") is used as server_name and if so replace _ with . --- templates/http/default.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/http/default.conf.j2 b/templates/http/default.conf.j2 index 834fb73..bd53dd5 100644 --- a/templates/http/default.conf.j2 +++ b/templates/http/default.conf.j2 @@ -83,7 +83,7 @@ server { root {{ item.value.root }}; {% endif %} {% if item.value.https_redirect is defined and item.value.https_redirect %} - return 301 https://{{ item.value.server_name }}$request_uri; + return 301 https://{% if item.value.server_name == "_" %}$host{% else %}{{ item.value.server_name }}{% endif %}$request_uri; {% endif %} {% if item.value.autoindex is defined and item.value.autoindex %} autoindex on;