diff --git a/registry/consul/routecmd.go b/registry/consul/routecmd.go index 7a17ef0be..aee5ec323 100644 --- a/registry/consul/routecmd.go +++ b/registry/consul/routecmd.go @@ -111,7 +111,10 @@ func parseURLPrefixTag(s, prefix string, env map[string]string) (route, opts str expand := func(s string) string { return os.Expand(s, func(x string) string { if env == nil { - return "" + return "$" + x + } + if _, ok := env[x]; !ok { + return "$" + x } return env[x] })