0%

Vercel和CloudFlare互斥

我警告你们,用Vercel部署博客千万不要和CloudFlare一起用!!!尤其不要开启CloudFlare的Proxy!!!老子要升天了!!!日妈批!!!

H λ L F - D E λ D梗


事情是如何发生的

自从用Vercel自动部署博客开始,一直收到这样的邮件:

From : system@vercel.com

To : windwords001@icloud.com

Subject : Your domain blog.windwords.me needs to be configured

======

Invalid Domain Configuration

Hi windwords,You have added the Domain blog.windwords.me to the Project blog on Vercel but it needs to be configured.

To configure the Domain, set the following record on your DNS provider (recommended):

name type value

blog CNAME cname.vercel-dns.com

Alternatively, you can also change your Domain’s nameservers to the following intended set:

ns1.vercel-dns.com

ns2.vercel-dns.com

We will periodically check your Domain and notify you when we detect a change.

If you do not want to receive reminders about updating the configuration of your Domain, you can remove it from your Project.

Thank you.


Vercel Inc. - vercel.com

If you’d like to talk to a Support Team member, simply reply to this email.

邮件里说我未设置CNAME记录,但是既然能访问,我显然是设置了的。

于是我去信询问为何一直这样报错(无视我的垃圾英语水平 >_<):

From : windwords001@icloud.com

To : support@vercel.com

Subject : Re: Your domain blog.windwords.me needs to be configured

======

I have received such emails time and time again, but my DNS has been set up:

blog CNAME cname.vercel-dns.com

www CNAME cname.vercel-dns.com

How to eliminate or turn off this prompt?

Sincerely,

windwords


Vercel的回应

过了一天左右,收到了这样的回复:

From : support@vercel.com

To : windwords001@icloud.com

Subject : RE: Re: Your domain blog.windwords.me needs to be configured

======

Hi there,

Thank you for getting in touch, I’m sorry to hear you’re having difficulty using the Vercel platform.

It appears your domain may be using Cloudflare with the proxy option enabled, this is likely the root cause of the issue you are facing.

At Vercel, we support this configuration without any issues, but you may need an additional configuration. Please read this support article for more information.

If you are facing difficulties configuring Cloudflare, we recommend that you reach out to their support channel.

William

根据邮件的指引看了下支持文档,其中说不能使用CloudFlare的Proxy功能,应设置为仅DNS(支持文档过长,这里只截取需要部分,其余用(* * *)代替):

How do I use a CloudFlare domain with Vercel?

If your domain is using Cloudflare’s Nameservers and you plan to use it as a custom domains on your project, you may need some minor steps to ensure the domain will work correctly.

Without Proxy

(* * *)

With Proxy

A Cloudflare proxy works as an intermediary between your domain and Vercel, which is the hosting provider. We don’t recommend that you enable the Cloudflare proxy unless you have specific constraints for your project since it will introduce a minor performance penalty to your website due to the additional hop. You need to insert a CNAME record with the value cname.vercel-dns.comor an A record with the value 76.76.21.21.

It is highly recommended that you don’t use the Cloudflare CDN with Vercel. When new deployments are created, the Vercel platform is unable to purge the content cached on Cloudflare. If your visitors load a cached /index.html requiring /static/script-abc.js, but this file is missing both in the new deployment and the Cloudflare CDN, the website will break. Therefore, turning off the Cloudflare CDN for pages is recommended to avoid any breakage. Please refer to the Cloudflare documentation for further information.

(* * *)

(* * *)

可以看出,Vercel和CloudFlare互斥,同时使用Vercel和CloudFlare会导致网站减速。Vercel甚至强烈不建议使用CloudFlare的CDN,因为这有可能导致网站出现问题。


解决方法

知道问题就好解决了。关闭CloudFlare的Proxy功能即可:

如果这样仍无法解决,那么也许你应该尝试彻底关闭CloudFlare的CDN功能或更换DNS服务商。

====== End ======