Skip to content

Ingress configuration doesn't work with proxy dns #346

Closed

Description

@daxxog

This configuration does not work:

tunnel: {{MY_TUNNEL_ID}}
credentials-file: {{MY_CREDENTIALS_FILE}}


ingress:
  - hostname: {{MY_HOSTNAME}}
    service: {{MY_SERVICE_URL}}
    originRequest:
      httpHostHeader: {{MY_HTTP_HOST_HEADER}}
  # Catch-all rule, which just responds with 404 if traffic doesn't match any of
  # the earlier rules
  - service: http_status:404


loglevel: debug
logfile: /var/log/cloudflared.log
proxy-dns: true
proxy-dns-port: 9053

However, if I comment out:

# proxy-dns: true
# proxy-dns-port: 9053

Then everything works fine.

Activity

  1. nmldiegues commented on Apr 4, 2021

    @nmldiegues
    Contributor

    I suspect it's because https://github.com/cloudflare/cloudflared/blob/master/cmd/cloudflared/tunnel/cmd.go#L299 was not updated to look for named tunnels. Should be an easy fix, something like:

    diff --git a/cmd/cloudflared/tunnel/configuration.go b/cmd/cloudflared/tunnel/configuration.go
    index 38b74d7c..300c9f85 100644
    --- a/cmd/cloudflared/tunnel/configuration.go
    +++ b/cmd/cloudflared/tunnel/configuration.go
    @@ -86,7 +86,7 @@ func logClientOptions(c *cli.Context, log *zerolog.Logger) {
     }
    
     func dnsProxyStandAlone(c *cli.Context) bool {
    -       return c.IsSet("proxy-dns") && (!c.IsSet("hostname") && !c.IsSet("tag") && !c.IsSet("hello-world"))
    +       return c.IsSet("proxy-dns") && (!c.IsSet("hostname") && !c.IsSet("tag") && !c.IsSet("hello-world") && !c.IsSet("tunnel"))
    
  2. daxxog commented on Apr 4, 2021

    @daxxog
    Author

    Additionally, I think https://github.com/cloudflare/cloudflared/blob/master/cmd/cloudflared/tunnel/configuration_test.go could use some more tests that catch some of these configuration issues.

  3. nmldiegues commented on Apr 5, 2021

    @nmldiegues
    Contributor

    This will be fixed in the next cloudflared release.

  4. nmldiegues commented on Apr 8, 2021

    @nmldiegues
    Contributor

    Release 2021.4.0 has this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions