From de71e1bdcc4890908bb8c1381c6cf460e50d42f3 Mon Sep 17 00:00:00 2001 From: E Mantel Date: Wed, 16 Nov 2016 20:51:03 +0100 Subject: [PATCH] Better display for server_name --- templates/etc/nginx/sites-available/_base.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/etc/nginx/sites-available/_base.j2 b/templates/etc/nginx/sites-available/_base.j2 index b172bca..df5c981 100644 --- a/templates/etc/nginx/sites-available/_base.j2 +++ b/templates/etc/nginx/sites-available/_base.j2 @@ -140,7 +140,7 @@ server { {% for port in __listen %} listen {{ port }}{% if nginx_default_vhost == __main_name %} default_server{% endif %}; {% endfor %} - server_name {% if item.name is string %}{{ item.name }}{% else %}{{ item.name | join(' ') }}{% endif %}; + server_name {% if item.name is string %}{{ item.name }}{% else %}{{ "\n\t\t" }}{{ item.name | join("\n\t\t") }}{% endif %}; return 301 https://{{ __main_name }}{% if '443' not in __listen_ssl %}:{{ __listen_ssl[0] }}{% endif %}$request_uri; } {% endif %} @@ -154,7 +154,7 @@ server { {% for port in __listen %} listen {{ port }}; {% endfor %} - server_name {% if item.redirect_from is string %}{{ item.redirect_from }}{% else %}{{ item.redirect_from | join(' ') }}{% endif %}; + server_name {% if item.redirect_from is string %}{{ item.redirect_from }}{% else %}{{ "\n\t\t" }}{{ item.redirect_from | join("\n\t\t") }}{% endif %}; return 301 $scheme://{{ __main_name }}$request_uri; } {% endif %}