Cloudflared access with self host Caddy Reverse Proxy

Fixed it - Cloudflare tunnels folks were super helpful on this.

Caddy is expecting the host header to match one from the the caddy config.

So where my caddy config looks like this:

caddy.localhost {
	reverse_proxy localhost:2222
}

cloudflare tunnels needs to be run with: httpHostHeader: caddy.localhostin your config file or–http-host-header caddy.localhost` on the CLI.

This does rewrite the host header, but im not sure if this will be an issue for me or not…