diff --git a/templates/etc/nginx/sites-available/vhost.j2 b/templates/etc/nginx/sites-available/vhost.j2 index bf00e1e..574488e 100644 --- a/templates/etc/nginx/sites-available/vhost.j2 +++ b/templates/etc/nginx/sites-available/vhost.j2 @@ -13,8 +13,8 @@ upstream {{ item.upstream.name }} { server { listen {{ server.port }}{{ ' ssl' if server.tls is defined and server.tls else '' }}; server_name {{ server.server_name }}; - {% if server.tls is defined and server.tls %} + ssl_certificate /etc/pki/tls/certs/{{ server.tls.cert }}; ssl_certificate_key /etc/pki/tls/private/{{ server.tls.key }}; {% if server.tls.dhparam is defined %} @@ -28,6 +28,7 @@ server { {% if server.client_max_body_size is defined and server.client_max_body_size %} client_max_body_size {{ server.client_max_body_size }}; {% endif %} + {% for location in server.locations %} location {{ location.match }} { {% if location.root is defined and location.root %} @@ -56,4 +57,5 @@ server { } {% endif %} } + {% endfor %}