我的这个博客网站使用Cloudflare CDN。
今天上午,Cloudflare给我发了一封电子邮件:您好, 经我们确定,您有一个或多个 Web 资产似乎在未使用相应付费服务的情况下提供视频或数量不相称的大型文件,如 R2、Stream 或 Cloudflare Images。 针对这一情况,我们暂时停止了对部分出现问题的流量的服务。在此问题解决之前,您的有些访问者可能会感觉到性能上的变化。如果我们认为此问题仍未解决,我们可能会采取进一步措施,包括继续更改性能或在网络中停用有问题的区域。 受影响的资产有: - zuotijia.me
意思是,Cloudflare检测到我的这个博客网站在“免费计划”下提供了大量视频或大文件下载,这违反了 Cloudflare 的使用规则,因此他们已经开始限制部分流量。
Cloudflare认为,我在利用免费 CDN 当做文件分发网络 / 下载站,这是 Cloudflare 免费计划不允许的。然后他们限制我这个网站的某些文件的 CDN 加速,导致我这个网站访问起来很卡。
使用curl命令获取我这个网站的响应头信息:
$ curl -I https://www.zuotijia.me
HTTP/2 302
date: Sat, 07 Mar 2026 06:44:20 GMT
location: https://www.cloudflare-terms-of-service-abuse.com/stream.ts
access-control-allow-origin: *
cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
expires: Thu, 01 Jan 1970 00:00:01 GMT
server: cloudflare
cf-ray: 9d87a18c0e060be4-AMS
可以看到:
HTTP/2 302
location: https://www.cloudflare-terms-of-service-abuse.com/stream.ts
server: cloudflare
这表示 Cloudflare 已经对我的域名启用了 “Terms of Service Abuse” 拦截。所有访问都会被 302 重定向到他们的滥用提示页面。
Cloudflare 的风控系统已经把我的站点标记为 CDN滥用状态,现在处于 强制限制模式。
那么如何解除这个强制限制模式?
首先要确定是哪些网站文件触发了这个Cloudflare的风控。前天我用一张120kb大小的图片设置为网站头像,应该是它引起的。然后我看了一下Cloudflare管理面板->分析和日志->Web Analytics页面,发现网站的首屏图片
#wp-custom-header>img
www.zuotijia.me/wp-content/themes/twentyseventeen/assets/images/header.jpg
它的LCP达到10,660 毫秒!那么它就是引起这一问题的罪魁祸首。
以前一直使用这个默认主题,为啥今天就触发Cloudflare的风控了呢?因为我这个网站的流量大起来了。
既然确定了引发问题的原因,那么解决步骤如下。
进入WordPress的管理后台->外观->自定义,在主题编辑页面,点击页眉媒体->隐藏页眉图片,再点击“发布”按钮保存更改。很多现代站点都不再用这种巨图。
再进入WordPress的管理后台->设置->常规页面,移除站点图标,然后点击最下方的“保存更改”按钮保存更改。
在Cloudflare的DNS配置页面中把网站的域名的CDN配置从Proxied(橙云)改为DNS only(灰云),绕过 Cloudflare 拦截,临时恢复网站的正常访问。
给Cloudflare回复以下邮件:
Hello,
We have identified the issue that triggered the abuse detection.
The large image resource causing excessive CDN traffic has been optimized and caching rules have been configured. The website is no longer serving large files through Cloudflare CDN.
Could you please review the restriction on the domain zuotijia.me and remove the abuse limitation?
Thank you.
意思是我已经移除了触发CDN限制的网站图片,请解除对我的域名的限制。
一般等个6到24小时,Cloudflare就能解除对我的域名的限制。
过段时间我给网站换个美观一点的主题。
