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 } ],