File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -112,11 +112,13 @@ upstream {{ $host }} {
112112{{ $certName := (first (groupByKeys $containers "Env.CERT_NAME")) }}
113113
114114{{/* Get the best matching cert by name for the vhost. */}}
115+ {{ $vhostCert := "" }}
116+ {{ if exists "/etc/nginx/certs" }}
115117{{ $vhostCert := (closest (dir "/etc/nginx/certs") (printf "%s.crt" $host))}}
116-
117- {{/* vhostCert is actually a filename so remove any suffixes since they are added later */ }}
118- {{ $vhostCert := replace $vhostCert ".crt " "" -1 }}
119- {{ $vhostCert := replace $vhostCert ".key" "" -1 }}
118+ {{/* vhostCert is actually a filename so remove any suffixes since they are added later */}}
119+ {{ $ vhostCert := replace $vhostCert ".crt" "" -1 }}
120+ {{ $vhostCert := replace $vhostCert ".key " "" -1 }}
121+ {{ end }}
120122
121123{{/* Use the cert specifid on the container or fallback to the best vhost match */}}
122124{{ $cert := (coalesce $certName $vhostCert) }}
You can’t perform that action at this time.
0 commit comments