Add check if catch-all ("_") is used as server_name and if so replace _ with .

This commit is contained in:
Philip Henning 2019-06-08 20:15:21 +02:00
parent e8295ef303
commit 956f37ac06

View File

@ -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;