summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy/caddyfile.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/reverseproxy/caddyfile.go')
-rw-r--r--modules/caddyhttp/reverseproxy/caddyfile.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go
index 71ed21f..da7450d 100644
--- a/modules/caddyhttp/reverseproxy/caddyfile.go
+++ b/modules/caddyhttp/reverseproxy/caddyfile.go
@@ -184,6 +184,13 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
if network != "" {
return caddy.JoinNetworkAddress(network, host, port), nil
}
+
+ // if the host is a placeholder, then we don't want to join with an empty port,
+ // because that would just append an extra ':' at the end of the address.
+ if port == "" && strings.Contains(host, "{") {
+ return host, nil
+ }
+
return net.JoinHostPort(host, port), nil
}