Can I have Local and Remote Reverse Proxy using the same Caddy Instance?

1. The problem I’m having:

I am trying to reverse proxy an internal site with both a local DNS record and a Cloudflare Zero-Trust tunnel external access.

I have a local DNS entry that points records.myhost.com to 10.0.0.200

  • When I do NOT have a Cloudflare DNS entry pointing at the tunnel, I can locally access records.myhost.com securely
  • When I HAVE a Cloudflare DNS entry pointing at the tunnel I can remotely access records.myhost.com securely, but local access is broken (ERR_SSL_PROTOCOL_ERROR)

Is it even possible to do this with 1 Caddy instance?

2. Error messages and/or full log output:

I probably need to enable higher logging, right now the log only contains info messages about ACME renewals

3. Caddy version:

Caddy version 2.8.4, docker image built ~9months ago with xcaddy and Cloudflare

RUN xcaddy build --with github.com/caddy-dns/cloudflare

FROM caddy:latest

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

4. How I installed and ran Caddy:

Docker on Unraid.

Caddyfile:

records.myhost.com {
	tls {
		dns cloudflare {env.CF_API_TOKEN}
	}
	reverse_proxy http://10.0.0.200:8000 {
	    header_down Referrer-Policy "strict-origin-when-cross-origin"
	}
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.