From 19cdab5ba4508e03c6a80dc25bd7b85295760a23 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Tue, 15 Nov 2016 17:15:39 +0100 Subject: [PATCH] default vhost on HTTPS redirect --- templates/etc/nginx/sites-available/_base.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/etc/nginx/sites-available/_base.j2 b/templates/etc/nginx/sites-available/_base.j2 index 633d070..b172bca 100644 --- a/templates/etc/nginx/sites-available/_base.j2 +++ b/templates/etc/nginx/sites-available/_base.j2 @@ -138,7 +138,7 @@ server { # server { {% for port in __listen %} - listen {{ port }}; + 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 %}; return 301 https://{{ __main_name }}{% if '443' not in __listen_ssl %}:{{ __listen_ssl[0] }}{% endif %}$request_uri;