diff --git a/caddyconfig/httpcaddyfile/addresses.go b/caddyconfig/httpcaddyfile/addresses.go index a4f07ae60db..e2e77719143 100644 --- a/caddyconfig/httpcaddyfile/addresses.go +++ b/caddyconfig/httpcaddyfile/addresses.go @@ -223,7 +223,7 @@ func (st *ServerType) listenerAddrsForServerBlockKey(sblock serverBlock, key str if err == nil && addr.IsUnixNetwork() { listeners[host] = struct{}{} } else { - listeners[net.JoinHostPort(host, lnPort)] = struct{}{} + listeners[host+":"+lnPort] = struct{}{} } } diff --git a/caddytest/integration/caddyfile_adapt/bind_ipv6.txt b/caddytest/integration/caddyfile_adapt/bind_ipv6.txt new file mode 100644 index 00000000000..d9d9bec6b25 --- /dev/null +++ b/caddytest/integration/caddyfile_adapt/bind_ipv6.txt @@ -0,0 +1,29 @@ +example.com { + bind tcp6/[::] +} +---------- +{ + "apps": { + "http": { + "servers": { + "srv0": { + "listen": [ + "tcp6/[::]:443" + ], + "routes": [ + { + "match": [ + { + "host": [ + "example.com" + ] + } + ], + "terminal": true + } + ] + } + } + } + } +} \ No newline at end of file