Skip to content

Ingress configuration doesn't work with proxy dns #346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
daxxog opened this issue Apr 3, 2021 · 4 comments
Closed

Ingress configuration doesn't work with proxy dns #346

daxxog opened this issue Apr 3, 2021 · 4 comments

Comments

@daxxog
Copy link

daxxog commented Apr 3, 2021

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.

@nmldiegues
Copy link
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"))

@daxxog
Copy link
Author

daxxog commented Apr 4, 2021

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.

@nmldiegues
Copy link
Contributor

This will be fixed in the next cloudflared release.

@nmldiegues
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants