From c6501209f8f0195aa3e42505f496c3369ddbf748 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Thu, 18 Jul 2019 22:51:05 +0200 Subject: [PATCH] small template fixes --- templates/etc/nginx/sites-available/vhost.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/etc/nginx/sites-available/vhost.j2 b/templates/etc/nginx/sites-available/vhost.j2 index 67b288f..0089a57 100644 --- a/templates/etc/nginx/sites-available/vhost.j2 +++ b/templates/etc/nginx/sites-available/vhost.j2 @@ -7,9 +7,9 @@ upstream {{ item.upstream.name }} { server {{ upserver }}; {% endfor %} } - {% endif %} {% for server in item.servers %} + server { listen {{ server.port }}{{ ' ssl' if server.tls is defined and server.tls else '' }}; server_name {{ server.server_name }}; @@ -36,14 +36,15 @@ server { {% endif %} {% if location.index is defined and location.index %} index {{ location.index }}; + {% endif %} {% if location.proxy_pass is defined and location.proxy_pass %} - - proxy_pass {{ location.proxy_pass }} + proxy_pass {{ location.proxy_pass }}; {% if location.proxy_http_version is defined and location.proxy_http_version %} proxy_http_version {{ location.proxy_http_version }}; {% endif %} {% for pheader in location.proxy_headers | default([]) %} + proxy_set_header {{ pheader }}; {% endfor %} {% endif %} @@ -57,5 +58,4 @@ server { } {% endif %} } - {% endfor %}