Cloudflare workers 可以绑定自已的域名吗?

2021-05-08 15:53:44 +08:00
 labulaka521

我使用 CNAME 到了 cloudflare workers 的域名,设置了路由,但是访问还是报错

Error 1021  Ray ID: 64c11ee5d7e2dcd2 • 2021-05-08 07:54:33 UTC
Could not find host
What happened?

You've requested a page on a website (gravatar.readrss.me) that is on the Cloudflare network. Cloudflare is currently unable to resolve your requested domain (gravatar.readrss.me). There are two potential causes of this:
Most likely: if the owner just signed up for Cloudflare it can take a few minutes for the website's information to be distributed to our global network.
Less likely: something is wrong with this site's configuration. Usually this happens when accounts have been signed up with a partner organization (e.g., a hosting provider) and the provider's DNS fails.
4432 次点击
所在节点    问与答
24 条回复
worryfree
2021-05-08 19:50:43 +08:00
脚本
XIU2
2021-05-08 19:53:58 +08:00
首先你的域名要托管在 Cloudflare 中。

然后去添加一个 A 记录解析,IP 随便写,开启橙色云朵(走 CDN )。
注意:如果你想要该域名自选 Cloudflare CDN IP,那么这里就要填写自选 IP,并不要开启橙色云朵(不走 CDN ),这样的话解析的就是自选 IP 了,而因为指向的还是 Cloudflare CDN IP,所以完全一样。

接着去网页顶部功能列表中选择 [Workers],点击 [添加路由],第一个 [路由] 输入你前面刚才添加的域名(域名后面以 /* 结尾), 第二个 [Worker] 选择你要指向的 Worker 名称,点击 [保存]。

完成~
简单来说就是添加一个域名 A 解析记录,并将其路由指向 Worker ~
richardwong
2021-05-09 14:41:25 +08:00
可以。我阿里云注册的域名,刚绑过去
lazygoat644
2022-06-01 11:08:04 +08:00
@XIU2 谢谢,设置的时候没有 /*,导致几乎无法跳转。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/775667

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX