From 0580726415962c3632e14ffed0d5b60417c46d91 Mon Sep 17 00:00:00 2001 From: Jason Wilder Date: Tue, 2 Dec 2014 23:29:00 -0700 Subject: [PATCH] Ensure cert exists before referencing it --- nginx.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.tmpl b/nginx.tmpl index 4c3295f..3de1843 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -79,7 +79,7 @@ upstream {{ $host }} { {{/* Use the cert specifid on the container or fallback to the best vhost match */}} {{ $cert := (coalesce $certName $vhostCert) }} -{{ if (ne $cert "") }} +{{ if (and (ne $cert "") (exists (printf "/etc/nginx/certs/%s.crt" $cert)) (exists (printf "/etc/nginx/certs/%s.key" $cert))) }} server { server_name {{ $host }};