Skip to content

docs: explain what Cloudflare can and cannot sit in front of - #60

Merged
semics-tech merged 1 commit into
mainfrom
docs/cloudflare
Jul 31, 2026
Merged

docs: explain what Cloudflare can and cannot sit in front of#60
semics-tech merged 1 commit into
mainfrom
docs/cloudflare

Conversation

@semics-tech

Copy link
Copy Markdown
Owner

Adds a Behind Cloudflare, or any CDN proxy section to docs/deployment.md, from a question that came up trying the Azure VM route.

Proxying the whole control plane through a CDN is the obvious first instinct, and half of it is right: Cloudflare in front of 443 removes the need to run ACME for the dashboard at all.

The hub is the other half, and it has to be grey-clouded.

Why this is worth writing down

Port 8443 is on Cloudflare's proxied HTTPS list, so this reads as supported. It isn't:

  • An L7 proxy resets a bidirectional stream well before its 100–120 s read timeout
  • Client certificates don't survive termination, so mTLS can't be used
  • Workers end up verifying the edge certificate rather than the one they were given to pin — --ca-cert quietly stops pinning anything

None of that fails at setup time. It shows up later as workers reconnecting constantly and an mTLS mode that can't be turned on.

Also recorded

A hub certificate is still required either way. RSAGENT_GRPC_REQUIRE_TLS is about the hub, not the dashboard, so putting a CDN in front of 443 doesn't remove it — which isn't obvious from the error text.

Two settings people will get wrong:

RSAGENT_TRUSTED_PROXY_HOPS Must count the CDN and the local proxy — 2 for Cloudflare → Caddy → server. Otherwise every audit row records an edge IP instead of a person
8080 firewall Restrict to Cloudflare's ranges, or the dashboard is reachable over plain HTTP at the origin address, where credential onboarding silently fails

Plus: use Full (strict), not Flexible; and DNS-01 is the way to get a public certificate for a grey-clouded name. Cloudflare Origin Certificates are explicitly ruled out — only Cloudflare's edge trusts them, and workers aren't Cloudflare's edge.

Generalised into the gotchas list too, since the reasoning isn't Cloudflare-specific — any WAF, ingress controller or application gateway in front of the hub fails the same way.

Docs only, no code. Anchors and relative links verified.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AyYg2j8FVkLjiaVcj5HCkj

Proxying the whole control plane through a CDN is the obvious first
instinct, and half of it is right: Cloudflare in front of 443 removes the
need to run ACME for the dashboard entirely.

The hub is the other half and it has to be grey-clouded. Port 8443 is on
Cloudflare's proxied HTTPS list, so this reads as supported and is not:
an L7 proxy resets a bidirectional stream well before its 100-120s read
timeout, client certificates do not survive termination, and workers end
up verifying the edge certificate rather than the one they were given to
pin — so --ca-cert quietly stops pinning anything. None of that fails at
setup time. It shows up later as workers that reconnect constantly and an
mTLS mode that cannot be turned on.

Also records that a certificate is still required either way. The startup
check is about the hub, not the dashboard, so putting a CDN in front of
443 does not remove it — which is not obvious from the error text.

Two settings people will get wrong: RSAGENT_TRUSTED_PROXY_HOPS has to
count the CDN as well as the local proxy, or every audit row records an
edge IP instead of a person; and 8080 needs restricting to the CDN's
ranges, or the dashboard is reachable over plain HTTP at the origin
address, where credential onboarding silently does not work.

Generalised into the gotchas list as well, because the reasoning is not
specific to Cloudflare — any WAF, ingress controller or application
gateway in front of the hub fails the same way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AyYg2j8FVkLjiaVcj5HCkj
@semics-tech
semics-tech merged commit 1bc5d29 into main Jul 31, 2026
9 checks passed
@semics-tech
semics-tech deleted the docs/cloudflare branch July 31, 2026 10:14
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

Successfully merging this pull request may close these issues.

1 participant