mirror of
https://github.com/thib8956/nginx-proxy
synced 2024-11-22 11:56:31 +00:00
commit
db3ef67a7f
10
nginx.tmpl
10
nginx.tmpl
@ -112,13 +112,11 @@ upstream {{ $host }} {
|
|||||||
{{ $certName := (first (groupByKeys $containers "Env.CERT_NAME")) }}
|
{{ $certName := (first (groupByKeys $containers "Env.CERT_NAME")) }}
|
||||||
|
|
||||||
{{/* Get the best matching cert by name for the vhost. */}}
|
{{/* 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 := (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 is actually a filename so remove any suffixes since they are added later */}}
|
||||||
{{ $vhostCert := replace $vhostCert ".key" "" -1 }}
|
{{ $vhostCert := replace $vhostCert ".crt" "" -1 }}
|
||||||
{{ end }}
|
{{ $vhostCert := replace $vhostCert ".key" "" -1 }}
|
||||||
|
|
||||||
{{/* Use the cert specified on the container or fallback to the best vhost match */}}
|
{{/* Use the cert specified on the container or fallback to the best vhost match */}}
|
||||||
{{ $cert := (coalesce $certName $vhostCert) }}
|
{{ $cert := (coalesce $certName $vhostCert) }}
|
||||||
|
Loading…
Reference in New Issue
Block a user