Преглед на файлове

Ensure cert exists before referencing it

Jason Wilder преди 10 години
родител
ревизия
0580726415
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      nginx.tmpl

+ 1 - 1
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 }};