From 580517725febf392092a29f1bfce9473a558bc66 Mon Sep 17 00:00:00 2001 From: Jason Wilder Date: Mon, 13 Jun 2016 00:10:49 -0600 Subject: [PATCH] Revert 9c93efa --- nginx.tmpl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nginx.tmpl b/nginx.tmpl index 6104f53..eb00afe 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -112,13 +112,11 @@ upstream {{ $host }} { {{ $certName := (first (groupByKeys $containers "Env.CERT_NAME")) }} {{/* Get the best matching cert by name for the vhost. */}} -{{ $vhostCert := "" }} -{{ if exists "/etc/nginx/certs" }} {{ $vhostCert := (closest (dir "/etc/nginx/certs") (printf "%s.crt" $host))}} - {{/* vhostCert is actually a filename so remove any suffixes since they are added later */}} - {{ $vhostCert := replace $vhostCert ".crt" "" -1 }} - {{ $vhostCert := replace $vhostCert ".key" "" -1 }} -{{ end }} + +{{/* vhostCert is actually a filename so remove any suffixes since they are added later */}} +{{ $vhostCert := replace $vhostCert ".crt" "" -1 }} +{{ $vhostCert := replace $vhostCert ".key" "" -1 }} {{/* Use the cert specified on the container or fallback to the best vhost match */}} {{ $cert := (coalesce $certName $vhostCert) }}