{"record":{"id":"38e9e88d67f31670","repo":"caddyserver/caddy","slug":"ambiguous-site-definition-s","errorCode":null,"errorMessage":"ambiguous site definition: %s","messagePattern":"ambiguous site definition: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"caddyconfig/httpcaddyfile/httptype.go","lineNumber":588,"sourceCode":"\t}\n\tautoHTTPS := []string{}\n\tif ah, ok := options[\"auto_https\"].([]string); ok {\n\t\tautoHTTPS = ah\n\t}\n\n\tfor i, p := range pairings {\n\t\t// detect ambiguous site definitions: server blocks which\n\t\t// have the same host bound to the same interface (listener\n\t\t// address), otherwise their routes will improperly be added\n\t\t// to the same server (see issue #4635)\n\t\tfor j, sblock1 := range p.serverBlocks {\n\t\t\tfor _, key := range sblock1.block.GetKeysText() {\n\t\t\t\tfor k, sblock2 := range p.serverBlocks {\n\t\t\t\t\tif k == j {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif slices.Contains(sblock2.block.GetKeysText(), key) {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"ambiguous site definition: %s\", key)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar (\n\t\t\taddresses []string\n\t\t\tprotocols [][]string\n\t\t)\n\n\t\tfor _, addressWithProtocols := range p.addressesWithProtocols {\n\t\t\taddresses = append(addresses, addressWithProtocols.address)\n\t\t\tprotocols = append(protocols, addressWithProtocols.protocols)\n\t\t}\n\n\t\tsrv := &caddyhttp.Server{\n\t\t\tListen:          addresses,\n\t\t\tListenProtocols: protocols,","sourceCodeStart":570,"sourceCodeEnd":606,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/caddyconfig/httpcaddyfile/httptype.go#L570-L606","documentation":"Error \"ambiguous site definition: %s\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at caddyconfig/httpcaddyfile/httptype.go:588 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make the site addresses unambiguous: combine the conflicting site blocks or give each site a distinct address so routes are not merged ambiguously."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}