From 5c5f2b82e4b3392f8103cfaf3c61c098664502f6 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 27 Jul 2019 13:06:38 +0200 Subject: [PATCH] allow lists for server_name --- templates/etc/nginx/sites-available/vhost.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/etc/nginx/sites-available/vhost.j2 b/templates/etc/nginx/sites-available/vhost.j2 index 5eff8a5..52eb98d 100644 --- a/templates/etc/nginx/sites-available/vhost.j2 +++ b/templates/etc/nginx/sites-available/vhost.j2 @@ -12,7 +12,11 @@ upstream {{ item.upstream.name }} { server { listen {{ server.port }}{{ ' ssl' if server.tls is defined and server.tls else '' }}; + {% if not server.server_name is string and server.server_name is iterable %} + server_name {{ server.server_name | join(" ") }}; + {% else %} server_name {{ server.server_name }}; + {% endif %} {% if server.tls is defined and server.tls %} ssl_certificate /etc/pki/tls/certs/{{ server.tls.cert }};