feat(demo): let Cloudflare own the demo's DNS record

The pre-existing A record for demo.nginxui.com has been removed, so the
hostname can now be attached as a custom domain rather than as a zone route
overlaying someone else's record.

This matters beyond tidiness: a route only works while a proxied DNS record
happens to exist, and that record was outside this repository. A custom domain
is created and maintained by wrangler from this config, so the whole routing
setup is reproducible from a clean checkout instead of depending on manual
dashboard state.

The zone route created earlier has been deleted, so exactly one mechanism now
serves the hostname.

Verified after propagation: demo.nginxui.com resolves, serves the SPA, reports
a healthy container, and still lets a base64url-encoded log path through to the
application.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
0xJacky
2026-08-02 13:04:33 +08:00
parent 6d8b9893e9
commit 871c597e15

View File

@@ -13,19 +13,15 @@
// way to reach the demo when the custom domain's DNS is being changed.
"workers_dev": true,
// A zone route, not a custom domain. custom_domain: true asks Cloudflare to
// take over the hostname's DNS record, which it refuses while an ordinary A
// record exists ("already has externally managed DNS records") — so every
// deploy reported a partial trigger update and exited non-zero even though
// the Worker itself deployed fine.
//
// A route overlays the existing proxied record instead of replacing it, which
// is what is actually serving demo.nginxui.com today. Switching to
// custom_domain later means deleting that DNS record first.
// A custom domain, so Cloudflare owns the DNS record for this hostname and
// wrangler recreates it from this config alone. This only works because the
// pre-existing A record was removed; with one present, Cloudflare refuses
// with "already has externally managed DNS records" and the deploy exits
// non-zero even though the Worker itself went out fine.
"routes": [
{
"pattern": "demo.nginxui.com/*",
"zone_name": "nginxui.com"
"pattern": "demo.nginxui.com",
"custom_domain": true
}
],