From 871c597e15a81d948faaabd452452ee9fa7b6397 Mon Sep 17 00:00:00 2001 From: 0xJacky Date: Sun, 2 Aug 2026 13:04:33 +0800 Subject: [PATCH] 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 --- cloudflare/wrangler.jsonc | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/cloudflare/wrangler.jsonc b/cloudflare/wrangler.jsonc index 8fa31bde..9cf6e95b 100644 --- a/cloudflare/wrangler.jsonc +++ b/cloudflare/wrangler.jsonc @@ -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 } ],