之前使用 Gitbook 绑定自定义域名 read.yixiao.org 做了一篇文档,域名是托管在 Cloudflare 的,使用 CNAME 的方式接入 gitbook,后来不使用 gitbook,改变 CNAME 解析,解析到我自己的服务器,同时开启 Cloudflare 的 CDN,但是访问 read,yixiao.org 依然跳转到 gitbook,一开始我以为是因为 DNS 缓存,但是我等待了 24 个小时,依然如此。
与这个情况一样.
尝试解决#
我想了很多办法,重置 DNS,删除 Cloudflare 缓存,但都无法解决
联系官方#
我尝试联系 Cloudflare,但可惜我是 Free 套餐,无法发工单,所以我无法联系到 Cloudflare 官方
之后在 GitHub 上联系了Gitbook 同时发邮件给 Gitbook,一天之后得到回复和解决。
解决方案#
是 Gitbook 从 Cloudflare 中删除了我的域名,之后就可以了
以下为解释原文#
Sorry for the trouble. I just wanted to give some additional context on this specific issue as it has been a recurring problem that we are aware of but sadly cannot be easily resolved.
TL;DR: To regain complete control of your custom hostname after it has been registered on app.gitbook.com, remove this custom hostname from our platform.
For the longer explanation:
We use Cloudflare to serve HTTPS traffic for all custom hostnames configured by our users.When a user configures a custom hostname, they point their DNS via CNAME to one of our domains (which, at the end of the chain points to Cloudflare). We then request Cloudflare (using their Cloudflare for SaaS product) to generate an SSL certificate for this hostname and serve the traffic properly.
When users move away from GitBook, they often don't remove their content from GitBook and only change the DNS on their side. We don't request to remove the hostname from Cloudflare for SaaS until the content is deleted from GitBook, as the goal is to avoid breaking links for URLs that are still pointing to GitBook.
We'd expect Cloudflare to always use the DNS setup of the domain as the primary factor for deciding where to route the traffic.
We don't know the rationale behind why Cloudflare routing continues internally routing the traffic to GitBook when the domain is no longer pointing to the GitBook hostname. But it is not us doing that intentionally.
机翻一下#
抱歉,添麻烦了。我只是想就这个特定问题提供一些额外的背景信息,因为这是一个我们知道但很遗憾无法轻易解决的反复出现的问题。
TL;DR:要在 app.gitbook.com 上注册后重新获得对自定义主机名的完全控制,请从我们的平台中删除此自定义主机名。
对于更长的解释:
我们使用 Cloudflare 为用户配置的所有自定义主机名提供 HTTPS 流量。
当用户配置自定义主机名时,他们通过 CNAME 将他们的 DNS 指向我们的域之一(在链的末端指向 Cloudflare)。然后我们请求 Cloudflare(使用他们的 Cloudflare for SaaS 产品)为此主机名生成 SSL 证书并正确地提供流量。
当用户离开 GitBook 时,他们通常不会从 GitBook 中删除他们的内容,而只会更改他们这边的 DNS。在内容从 GitBook 中删除之前,我们不会请求从 Cloudflare for SaaS 中删除主机名,因为目标是避免断开仍指向 GitBook 的 URL 的链接。
我们希望 Cloudflare 始终使用域的 DNS 设置作为决定将流量路由到何处的主要因素。
我们不知道为什么 Cloudflare 路由在域不再指向 GitBook 主机名时继续在内部将流量路由到 GitBook 背后的基本原理。但这不是我们故意这样做的。
总结#
这似乎是 Cloudflare 的问题,看一些帖子,官方计划去年 12 月解决该问题
simon-cf(I work at Cloudflare) are going to change the way this works so that the authoritative DNS dictates the behaviour, rather than the internal state where we currently require SSL for SaaS providers to manage off-boarding of their own customers. This work has been planned for some time and we're very pleased it will be done soon!
Current ETA for this is December.
simon-cf: 我们将改变这种工作方式,以便权威 DNS 决定行为,而不是我们目前要求 SaaS 提供商使用 SSL 来管理其自己客户的离职的内部状态。这项工作已经计划了一段时间,我们很高兴它将很快完成!
目前的预计到达时间为 12 月。
(机翻)
但是至少目前并没有解决,希望尽快解决,这给我带来了很大的困扰。。。。