|
@@ -3,6 +3,7 @@
|
|
{{ $external_http_port := coalesce $.Env.HTTP_PORT "80" }}
|
|
{{ $external_http_port := coalesce $.Env.HTTP_PORT "80" }}
|
|
{{ $external_https_port := coalesce $.Env.HTTPS_PORT "443" }}
|
|
{{ $external_https_port := coalesce $.Env.HTTPS_PORT "443" }}
|
|
{{ $debug_all := $.Env.DEBUG }}
|
|
{{ $debug_all := $.Env.DEBUG }}
|
|
|
|
+{{ $sha1_upstream_name := parseBool (coalesce $.Env.SHA1_UPSTREAM_NAME "false") }}
|
|
|
|
|
|
{{ define "ssl_policy" }}
|
|
{{ define "ssl_policy" }}
|
|
{{ if eq .ssl_policy "Mozilla-Modern" }}
|
|
{{ if eq .ssl_policy "Mozilla-Modern" }}
|
|
@@ -153,7 +154,8 @@ server {
|
|
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
|
|
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
|
|
|
|
|
|
{{ $host := trim $host }}
|
|
{{ $host := trim $host }}
|
|
-{{ $upstream_name := sha1 $host }}
|
|
|
|
|
|
+{{ $is_regexp := hasPrefix "~" $host }}
|
|
|
|
+{{ $upstream_name := when (or $is_regexp $sha1_upstream_name) (sha1 $host) $host }}
|
|
|
|
|
|
# {{ $host }}
|
|
# {{ $host }}
|
|
upstream {{ $upstream_name }} {
|
|
upstream {{ $upstream_name }} {
|