Fix dev proxy fallbacks

This commit is contained in:
Arnie 2020-10-06 12:12:00 +02:00
parent 65fc1b91a4
commit 4d9365e411

View File

@ -1,18 +1,21 @@
{{ $CurrentContainer := where $ "ID" .Docker.CurrentContainerID | first }} {{ $CurrentContainer := where $ "ID" .Docker.CurrentContainerID | first }}
{{ $hosts := groupByMulti $ "Env.VIRTUAL_HOST" "," }} {{ $hosts := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
{{ if not $hosts }}
127.0.0.1:80
log stdout
errors stderr
{{ else }}
{ {
auto_https disable_redirects auto_https disable_redirects
local_certs local_certs
} }
:80 {
log {
output stdout
}
respond "Site is not registered with proxy."
}
{{ if $hosts }}
{{ range $host, $containers := $hosts }} {{ range $host, $containers := $hosts }}
{{ $c := first $containers }} {{ $c := first $containers }}
{{ $tlsOff := trim (index $c.Env "VIRTUAL_DISABLE_TLS") }} {{ $tlsOff := trim (index $c.Env "VIRTUAL_DISABLE_TLS") }}