A take-home deep dive into Cloudflare Application Services — two hostnames, one origin, and the architecture decisions that tie them together.
Two hostnames, one origin — each transport chosen deliberately based on security posture and plan constraints.
Proxied A record pointing to the origin IP. Edge validates a Let's Encrypt certificate at SSL mode Full (Strict). Hardened with a Cloudflare IP allowlist and Authenticated Origin Pulls (mTLS).
Proxied CNAME to a Cloudflare Tunnel. cloudflared dials outbound — no origin IP, no listener, no exposed attack surface whatsoever.
The DNS record type is what selects the edge-to-origin transport — and that choice has consequences.
Origin Rules DNS overrides that would allow a single hostname to switch transports are an Enterprise-only feature. On the free tier, the A record and the Tunnel CNAME must live on separate hostnames. This split is forced by a plan boundary — not a design preference.
Edge connects to origin IP; Full (Strict) applies.
Edge connects via cloudflared; origin IP never exposed.
tunnel.berglabs.net/secureThe binding to R2 is the authorization — no stored credentials, no scoped keys, no rotation schedule. The Worker inherits access through its runtime binding alone.
The same handler logic runs on a Node.js origin inside a Proxmox container — revealing exactly what the edge binding eliminates.
request.cf ✅No credential to store. No rotation to schedule. No scope to misconfigure. The Worker's R2 binding carries implicit, scoped access — the operational burden simply disappears.
Full (Strict) requires a reachable origin IP. A Tunnel-only posture exposes none. These two goals are in direct conflict — and the architecture must hold both simultaneously.

app.berglabs.net and tunnel.berglabs.net coexist today — each serving its role while demonstrating both transports.
Tunnel-only is the recommended production posture. Eliminating the origin IP from DNS entirely removes the most significant attack vector.
app.berglabs.net: Defense in DepthEdge validates the origin's Let's Encrypt certificate end-to-end — no opportunistic encryption, no self-signed bypass.
Origin firewall accepts connections only from Cloudflare's published IP ranges — direct connections are dropped at the network layer.
mTLS ensures the origin only accepts requests carrying Cloudflare's client certificate — spoofed proxies are rejected cryptographically.
Every security claim is falsifiable — here is the evidence that each control actually works.
Connections made directly to the origin IP without Cloudflare's mTLS client certificate are rejected — confirming the Authenticated Origin Pulls control is active.
terraform plan reports zero changes — the declared infrastructure state matches the live Cloudflare configuration with no drift.
The Worker code lives in a public repository and is deployed automatically via CI — reviewable, reproducible, and auditable end-to-end.
DNS record type selects transport; Origin Rules DNS override is Enterprise-only — the split is structural, not stylistic.
No origin IP in DNS, no inbound listener — cloudflared's outbound dial is the production-grade posture.
R2 access at the edge requires zero stored credentials. The operational delta versus a Node origin is stark and measurable.
Securing and Serving at the Cloudflare Edge