Skip to content

Commit 0580726

Browse files
committed
Ensure cert exists before referencing it
1 parent 35b81f5 commit 0580726

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nginx.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ upstream {{ $host }} {
7979
{{/* Use the cert specifid on the container or fallback to the best vhost match */}}
8080
{{ $cert := (coalesce $certName $vhostCert) }}
8181

82-
{{ if (ne $cert "") }}
82+
{{ if (and (ne $cert "") (exists (printf "/etc/nginx/certs/%s.crt" $cert)) (exists (printf "/etc/nginx/certs/%s.key" $cert))) }}
8383

8484
server {
8585
server_name {{ $host }};

0 commit comments

Comments
 (0)