Log reasonning when falling back on default certificate
This commit is contained in:
parent
f1baeda5d4
commit
537334f3db
1 changed files with 7 additions and 1 deletions
|
@ -244,8 +244,14 @@ upstream {{ $upstream_name }} {
|
||||||
{{ if $is_https }}
|
{{ if $is_https }}
|
||||||
{{/* No cert? But we do want HTTPS! Let's fallback on the nginx default one.
|
{{/* No cert? But we do want HTTPS! Let's fallback on the nginx default one.
|
||||||
And set up acme-challenge so that Let's Encrpyt can do its job */}}
|
And set up acme-challenge so that Let's Encrpyt can do its job */}}
|
||||||
|
{{ if (eq $cert "") }}
|
||||||
|
# WARNING: No certificate found - Using 'default' as fallback
|
||||||
|
{{ else }}
|
||||||
|
{{ if (not (and (exists (printf "/etc/nginx/certs/%s.crt" $cert)) (exists (printf "/etc/nginx/certs/%s.key" $cert)))) }}
|
||||||
|
# WARNING: Certificate '{{ $cert }}' doesn't exist yet - Falling back on 'default'
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
{{ $cert := coalesce $cert "default" }}
|
{{ $cert := coalesce $cert "default" }}
|
||||||
{{/* Very same reasoning as above */}}
|
|
||||||
{{ $cert := when (and (exists (printf "/etc/nginx/certs/%s.crt" $cert)) (exists (printf "/etc/nginx/certs/%s.key" $cert))) $cert "default" }}
|
{{ $cert := when (and (exists (printf "/etc/nginx/certs/%s.crt" $cert)) (exists (printf "/etc/nginx/certs/%s.key" $cert))) $cert "default" }}
|
||||||
|
|
||||||
{{ if eq $https_method "redirect" }}
|
{{ if eq $https_method "redirect" }}
|
||||||
|
|
Loading…
Reference in a new issue