From b06f3f5d788237e574f359356fce6c91e33b5404 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 3 Apr 2024 00:40:34 +0200 Subject: nginx/vhost: fix string concat issue incase nginx_vhost.name is not a string --- roles/nginx/vhost/templates/no-tls.conf.j2 | 4 ++-- roles/nginx/vhost/templates/tls-only.conf.j2 | 4 ++-- roles/nginx/vhost/templates/tls-with-redirect.conf.j2 | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/roles/nginx/vhost/templates/no-tls.conf.j2 b/roles/nginx/vhost/templates/no-tls.conf.j2 index 29a62c8a..ddb2f229 100644 --- a/roles/nginx/vhost/templates/no-tls.conf.j2 +++ b/roles/nginx/vhost/templates/no-tls.conf.j2 @@ -4,8 +4,8 @@ server { {% endfor %} server_name {{ nginx_vhost.hostnames | default(['_']) | join(' ') }}; - access_log {{ nginx_vhost.logs.access | default('/var/log/nginx/' + nginx_vhost.name + '_access.log') }}; - error_log {{ nginx_vhost.logs.error | default('/var/log/nginx/' + nginx_vhost.name + '_error.log') }}; + access_log {{ nginx_vhost.logs.access | default('/var/log/nginx/' ~ nginx_vhost.name ~ '_access.log') }}; + error_log {{ nginx_vhost.logs.error | default('/var/log/nginx/' ~ nginx_vhost.name ~ '_error.log') }}; {% include 'includes/body.j2' %} } diff --git a/roles/nginx/vhost/templates/tls-only.conf.j2 b/roles/nginx/vhost/templates/tls-only.conf.j2 index 05820d96..27ef51cb 100644 --- a/roles/nginx/vhost/templates/tls-only.conf.j2 +++ b/roles/nginx/vhost/templates/tls-only.conf.j2 @@ -4,8 +4,8 @@ server { {% endfor %} server_name {{ nginx_vhost.hostnames | default(['_']) | join(' ') }}; - access_log {{ nginx_vhost.logs.access | default('/var/log/nginx/' + nginx_vhost.name + '_access.log') }}; - error_log {{ nginx_vhost.logs.error | default('/var/log/nginx/' + nginx_vhost.name + '_error.log') }}; + access_log {{ nginx_vhost.logs.access | default('/var/log/nginx/' ~ nginx_vhost.name ~ '_access.log') }}; + error_log {{ nginx_vhost.logs.error | default('/var/log/nginx/' ~ nginx_vhost.name ~ '_error.log') }}; {% if nginx_vhost.tls.certificate_provider == 'acmetool' or nginx_vhost.tls.certificate_provider == 'uacme' %} include snippets/{{ nginx_vhost.tls.certificate_provider }}.conf; diff --git a/roles/nginx/vhost/templates/tls-with-redirect.conf.j2 b/roles/nginx/vhost/templates/tls-with-redirect.conf.j2 index d131fe2a..542650b0 100644 --- a/roles/nginx/vhost/templates/tls-with-redirect.conf.j2 +++ b/roles/nginx/vhost/templates/tls-with-redirect.conf.j2 @@ -4,8 +4,8 @@ server { {% endfor %} server_name {{ nginx_vhost.hostnames | default(['_']) | join(' ') }}; - access_log {{ nginx_vhost.logs.access | default('/var/log/nginx/' + nginx_vhost.name + '_access.log') }}; - error_log {{ nginx_vhost.logs.error | default('/var/log/nginx/' + nginx_vhost.name + '_error.log') }}; + access_log {{ nginx_vhost.logs.access | default('/var/log/nginx/' ~ nginx_vhost.name ~ '_access.log') }}; + error_log {{ nginx_vhost.logs.error | default('/var/log/nginx/' ~ nginx_vhost.name ~ '_error.log') }}; {% if 'tls' in nginx_vhost %} {% if nginx_vhost.tls.certificate_provider == 'acmetool' or nginx_vhost.tls.certificate_provider == 'uacme' %} @@ -23,8 +23,8 @@ server { {% endfor %} server_name {{ nginx_vhost.hostnames | default(['_']) | join(' ') }}; - access_log {{ nginx_vhost.logs.access | default('/var/log/nginx/' + nginx_vhost.name + '_access.log') }}; - error_log {{ nginx_vhost.logs.error | default('/var/log/nginx/' + nginx_vhost.name + '_error.log') }}; + access_log {{ nginx_vhost.logs.access | default('/var/log/nginx/' ~ nginx_vhost.name ~ '_access.log') }}; + error_log {{ nginx_vhost.logs.error | default('/var/log/nginx/' ~ nginx_vhost.name ~ '_error.log') }}; {% if nginx_vhost.tls.certificate_provider == 'acmetool' or nginx_vhost.tls.certificate_provider == 'uacme' %} include snippets/{{ nginx_vhost.tls.certificate_provider }}.conf; -- cgit v1.2.3