From 5d65c9c97644dd6eaa89144e5556bcba66ffe439 Mon Sep 17 00:00:00 2001 From: nd Date: Fri, 22 May 2020 21:57:17 +0200 Subject: [PATCH] added support for custom tls certificates --- README.md | 6 ++++++ templates/vhost.conf.j2 | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 16fbfe8..e8f6f14 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,12 @@ auth: *authconfig* # array of headers to add on this vhost add_headers: [] + +# SSL key, mutally exclusive with letsencrypt option +key: ~ + +# SSL certificat, mutally exclusive with letsencrypt option +crt: ~ ``` **locationconfig**: diff --git a/templates/vhost.conf.j2 b/templates/vhost.conf.j2 index 1e14ef9..fe80cb8 100644 --- a/templates/vhost.conf.j2 +++ b/templates/vhost.conf.j2 @@ -80,5 +80,8 @@ server { {% if vhost.letsencrypt|d(False) %} ssl_certificate /etc/ssl/nginx_{{ vhost_name }}.chain.crt; ssl_certificate_key /etc/ssl/private/nginx_{{ vhost_name }}.key; + {% elif vhost.crt|d(None) and vhost.key|d(None) %} + ssl_certificate {{ vhost.crt }}; + ssl_certificate_key {{ vhost.key }}; {% endif %} }