{"record":{"id":"539d8d68647acd76","repo":"cloudflare/cloudflared","slug":"errurlincompatiblewithingress","errorCode":"ErrURLIncompatibleWithIngress","errorMessage":"You can't set the --url flag (or $TUNNEL_URL) when using multiple-origin ingress rules","messagePattern":"You can't set the --url flag \\(or \\$TUNNEL_URL\\) when using multiple-origin ingress rules","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ingress/ingress.go","lineNumber":27,"sourceCode":"\t\"strings\"\n\n\t\"github.com/pkg/errors\"\n\t\"github.com/rs/zerolog\"\n\t\"github.com/urfave/cli/v2\"\n\t\"golang.org/x/net/idna\"\n\n\t\"github.com/cloudflare/cloudflared/config\"\n\t\"github.com/cloudflare/cloudflared/ingress/middleware\"\n\t\"github.com/cloudflare/cloudflared/ipaccess\"\n)\n\nvar (\n\tErrNoIngressRules             = errors.New(\"The config file doesn't contain any ingress rules\")\n\tErrNoIngressRulesCLI          = errors.New(\"No ingress rules were defined in provided config (if any) nor from the cli, cloudflared will return 503 for all incoming HTTP requests\")\n\terrLastRuleNotCatchAll        = errors.New(\"The last ingress rule must match all URLs (i.e. it should not have a hostname or path filter)\")\n\terrBadWildcard                = errors.New(\"Hostname patterns can have at most one wildcard character (\\\"*\\\") and it can only be used for subdomains, e.g. \\\"*.example.com\\\"\")\n\terrHostnameContainsPort       = errors.New(\"Hostname cannot contain a port\")\n\tErrURLIncompatibleWithIngress = errors.New(\"You can't set the --url flag (or $TUNNEL_URL) when using multiple-origin ingress rules\")\n)\n\nconst (\n\tServiceBastion     = \"bastion\"\n\tServiceSocksProxy  = \"socks-proxy\"\n\tServiceWarpRouting = \"warp-routing\"\n)\n\n// FindMatchingRule returns the index of the Ingress Rule which matches the given\n// hostname and path. This function assumes the last rule matches everything,\n// which is the case if the rules were instantiated via the ingress#Validate method.\n//\n// Negative index rule signifies local cloudflared rules (not-user defined).\nfunc (ing Ingress) FindMatchingRule(hostname, path string) (*Rule, int) {\n\t// The hostname might contain port. We only want to compare the host part with the rule\n\thost, _, err := net.SplitHostPort(hostname)\n\tif err == nil {\n\t\thostname = host","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/ingress/ingress.go#L9-L45","documentation":"ErrURLIncompatibleWithIngress (public) is returned when the --url flag (or $TUNNEL_URL) is set alongside config-file ingress rules. These two routing mechanisms are mutually exclusive: --url defines a single origin, while ingress rules define multiple origins.","triggerScenarios":"validateIngressCommand sees c.IsSet(\"url\") true while the user is running an ingress-related tunnel command that also loads ingress rules from a config file.","commonSituations":"Environment variable TUNNEL_URL left set in the shell/container while using a config.yml with ingress rules; mixing CLI single-origin flags with a multi-origin config during migration.","solutions":["Remove the --url flag from the command line","Unset the TUNNEL_URL environment variable (unset TUNNEL_URL)","Keep the origin routing solely in the ingress rules config file"],"exampleFix":"// before\nTUNNEL_URL=http://localhost:8080 cloudflared tunnel ingress validate\n// after\nunset TUNNEL_URL\ncloudflared tunnel ingress validate","handlingStrategy":"validation","validationCode":"if os.Getenv(\"TUNNEL_URL\") != \"\" { // remove it before using ingress rules }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the environment for TUNNEL_URL in containers/CI before ingress-based runs","Use either --url OR ingress rules, never both","Audit wrapper scripts for hardcoded --url flags"],"tags":["cli","config","ingress","flags"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}