{"record":{"id":"851e1a69936b4ca4","repo":"caddyserver/caddy","slug":"invalid-downstream-address-s-v","errorCode":null,"errorMessage":"invalid downstream address %s: %v","messagePattern":"invalid downstream address (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddyhttp/reverseproxy/command.go","lineNumber":112,"sourceCode":"\tinternalCerts := fs.Bool(\"internal-certs\")\n\taccessLog := fs.Bool(\"access-log\")\n\tdebug := fs.Bool(\"debug\")\n\n\thttpPort := strconv.Itoa(caddyhttp.DefaultHTTPPort)\n\thttpsPort := strconv.Itoa(caddyhttp.DefaultHTTPSPort)\n\n\tto, err := fs.GetStringSlice(\"to\")\n\tif err != nil {\n\t\treturn caddy.ExitCodeFailedStartup, fmt.Errorf(\"invalid to flag: %v\", err)\n\t}\n\tif len(to) == 0 {\n\t\treturn caddy.ExitCodeFailedStartup, fmt.Errorf(\"--to is required\")\n\t}\n\n\t// set up the downstream address; assume missing information from given parts\n\tfromAddr, err := httpcaddyfile.ParseAddress(from)\n\tif err != nil {\n\t\treturn caddy.ExitCodeFailedStartup, fmt.Errorf(\"invalid downstream address %s: %v\", from, err)\n\t}\n\tif fromAddr.Path != \"\" {\n\t\treturn caddy.ExitCodeFailedStartup, fmt.Errorf(\"paths are not allowed: %s\", from)\n\t}\n\tif fromAddr.Scheme == \"\" {\n\t\tif fromAddr.Port == httpPort || fromAddr.Host == \"\" {\n\t\t\tfromAddr.Scheme = \"http\"\n\t\t} else {\n\t\t\tfromAddr.Scheme = \"https\"\n\t\t}\n\t}\n\tif fromAddr.Port == \"\" {\n\t\tswitch fromAddr.Scheme {\n\t\tcase \"http\":\n\t\t\tfromAddr.Port = httpPort\n\t\tcase \"https\":\n\t\t\tfromAddr.Port = httpsPort\n\t\t}","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddyhttp/reverseproxy/command.go#L94-L130","documentation":"The --from (downstream/listener) address of 'caddy reverse-proxy' failed httpcaddyfile.ParseAddress. This is the address Caddy serves on, and it must be a plain host/port/scheme combination; the '%v' carries the parse detail.","triggerScenarios":"'caddy reverse-proxy --from \"ht!p://bad\" ...' or addresses with invalid characters, bad brackets, or malformed port.","commonSituations":"Typos in the scheme, stray URL components, or unquoted shell metacharacters in --from.","solutions":["Use a simple value: domain, :port, or scheme://host:port, properly quoted.","Fix the specific syntax error named by the wrapped message.","Prefer 'caddy reverse-proxy --from localhost:8080' style during testing to minimize parse surface."],"exampleFix":"# before\ncaddy reverse-proxy --from 'exam ple.com:443' --to localhost:8080\n\n# after\ncaddy reverse-proxy --from 'example.com:443' --to localhost:8080","handlingStrategy":"validation","validationCode":"if _, err := httpcaddyfile.ParseAddress(from); err != nil {\n    return fmt.Errorf(\"--from %q is not a valid site address: %v\", from, err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep --from as domain, host:port, :port, or scheme://host:port — nothing else.","Quote the flag value in shell scripts.","Use 'caddy validate' equivalents (adapt/validate) when generating configs programmatically."],"tags":["cli","reverse-proxy","address-parsing","startup"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}