From 979027e192d9d45e83fba71afae542fffcdae3bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Fri, 14 May 2021 22:46:41 +0200 Subject: [PATCH] Change certificate paths in nginx.conf --- roles/nginx/templates/nginx.conf.j2 | 5 +++-- roles/nginx/templates/snippets/self-signed.conf.j2 | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 roles/nginx/templates/snippets/self-signed.conf.j2 diff --git a/roles/nginx/templates/nginx.conf.j2 b/roles/nginx/templates/nginx.conf.j2 index dc3ffc0..255f97c 100644 --- a/roles/nginx/templates/nginx.conf.j2 +++ b/roles/nginx/templates/nginx.conf.j2 @@ -27,7 +27,8 @@ http { #gzip on; resolver 127.0.0.11 valid=30; - ssl_certificate /etc/nginx/{{ base_domain }}.crt; - ssl_certificate_key /etc/nginx/{{ base_domain }}.key; + {% if self_signed == true %} + include /etc/nginx/snippets/self-signed.conf; + {% endif %} include /etc/nginx/conf.d/*.conf; } \ No newline at end of file diff --git a/roles/nginx/templates/snippets/self-signed.conf.j2 b/roles/nginx/templates/snippets/self-signed.conf.j2 new file mode 100644 index 0000000..aa3a09c --- /dev/null +++ b/roles/nginx/templates/snippets/self-signed.conf.j2 @@ -0,0 +1,2 @@ +ssl_certificate /etc/ssl/{{ base_domain }}.crt; +ssl_certificate_key /etc/ssl/{{ base_domain }}.key; \ No newline at end of file