1
0
Fork 0
mirror of https://github.com/nginx-proxy/nginx-proxy synced 2024-03-28 17:59:59 +01:00

feat: sha1 upstream names

This commit is contained in:
Nicolas Duchon 2021-08-17 21:51:09 +02:00
parent d10531e925
commit e748ffdce4
No known key found for this signature in database
GPG Key ID: EA3151C66A4D79E7

View File

@ -3,6 +3,7 @@
{{ $external_http_port := coalesce $.Env.HTTP_PORT "80" }}
{{ $external_https_port := coalesce $.Env.HTTPS_PORT "443" }}
{{ $debug_all := $.Env.DEBUG }}
{{ $sha1_upstream_name := parseBool (coalesce $.Env.SHA1_UPSTREAM_NAME "false") }}
{{ define "ssl_policy" }}
{{ if eq .ssl_policy "Mozilla-Modern" }}
@ -153,7 +154,8 @@ server {
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_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 }}
upstream {{ $upstream_name }} {