diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go index 9f84a90da..7a9042367 100644 --- a/modules/caddyhttp/matchers.go +++ b/modules/caddyhttp/matchers.go @@ -342,7 +342,11 @@ outer: } host = repl.ReplaceAll(host, "") - if strings.Contains(host, "*") { + + // a single * always match + if host == "*" { + return true, nil + } if strings.Contains(host, "*") { patternParts := strings.Split(host, ".") incomingParts := strings.Split(reqHost, ".") if len(patternParts) != len(incomingParts) {