<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Cloudflare on Kevin&#39;s Blog</title>
    <link>https://bloglee.pages.dev/tags/cloudflare/</link>
    <description>Recent content in Cloudflare on Kevin&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>zh</language>
    <lastBuildDate>Fri, 27 Feb 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://bloglee.pages.dev/tags/cloudflare/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>集成 cloudflare 的 Turnstile </title>
      <link>https://bloglee.pages.dev/post/integrate-cloudflare-turnstile/</link>
      <pubDate>Fri, 27 Feb 2026 00:00:00 +0000</pubDate>
      <guid>https://bloglee.pages.dev/post/integrate-cloudflare-turnstile/</guid>
      <description>&lt;h2 id=&#34;变量&#34;&gt;变量&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;NEXT_PUBLIC_TURNSTILE_SITE_KEY： 构建时变量，需要配置到 build time 中&lt;/li&gt;&#xA;&lt;li&gt;TURNSTILE_SECRET_KEY&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;步骤&#34;&gt;步骤&lt;/h2&gt;&#xA;&lt;h3 id=&#34;turnstile-widgets&#34;&gt;Turnstile widgets&lt;/h3&gt;&#xA;&lt;h3&gt;&lt;/h3&gt;</description>
    </item>
    <item>
      <title>Clouflare Queue</title>
      <link>https://bloglee.pages.dev/post/cloudflare-queues/</link>
      <pubDate>Mon, 02 Feb 2026 00:00:00 +0000</pubDate>
      <guid>https://bloglee.pages.dev/post/cloudflare-queues/</guid>
      <description>&lt;h2 id=&#34;是什么&#34;&gt;是什么&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;是 Cloudflare的消息队列&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;目的&#34;&gt;目的&lt;/h3&gt;&#xA;&lt;p&gt;解耦、削峰、异步化&lt;/p&gt;&#xA;&lt;h3 id=&#34;优势&#34;&gt;优势&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;至少一次（at-least-once）投递&lt;/li&gt;&#xA;&lt;li&gt;批处理/重试/延迟&lt;/li&gt;&#xA;&lt;li&gt;死信队列（DLQ）&lt;/li&gt;&#xA;&lt;li&gt;不收 egress 带宽费&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;解决了什么问题&#34;&gt;解决了什么问题&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;把重活从请求链路“挪走”：HTTP 请求先快速返回，把耗时任务（发邮件、写数据库、调用第三方 API、生成任务等）丢进队列慢慢处理，避免超时与抖动。&lt;/li&gt;&#xA;&lt;li&gt;削峰填谷：流量突刺时先入队，消费者按可控并发/批量处理，防止下游（DB / 第三方）被打爆。&lt;/li&gt;&#xA;&lt;li&gt;可靠性：失败自动重试，超过重试上限可进 DLQ 便于排查（否则达到上限会被删除）。&lt;/li&gt;&#xA;&lt;li&gt;Workers 之外也能消费：支持 pull consumer，外部服务用 HTTP 拉取并 ack（注意是短轮询）。&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Cloudflare Worker 介绍</title>
      <link>https://bloglee.pages.dev/post/cloudflare-worker/</link>
      <pubDate>Fri, 16 Jan 2026 00:00:00 +0000</pubDate>
      <guid>https://bloglee.pages.dev/post/cloudflare-worker/</guid>
      <description>&lt;h2 id=&#34;environment-variables--环境变量&#34;&gt;Environment variables / 环境变量&lt;/h2&gt;&#xA;&lt;h3 id=&#34;运行时环境变量&#34;&gt;运行时环境变量&lt;/h3&gt;&#xA;&lt;h3 id=&#34;build-time环境变量&#34;&gt;build time环境变量&lt;/h3&gt;</description>
    </item>
    <item>
      <title>打造近乎免费的高端企业邮箱 (Cloudflare &#43; AWS SES &#43; Gmail)</title>
      <link>https://bloglee.pages.dev/post/cloudflare-aws-ses/</link>
      <pubDate>Wed, 14 Jan 2026 00:00:00 +0000</pubDate>
      <guid>https://bloglee.pages.dev/post/cloudflare-aws-ses/</guid>
      <description>&lt;p&gt;&lt;strong&gt;背景：&lt;/strong&gt;&#xA;为了给 &lt;code&gt;Example.com&lt;/code&gt; 配置 &lt;code&gt;support@&lt;/code&gt; 企业邮箱，不想买 Google Workspace（$6/月），于是采用了“拼接”方案。&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;收信&lt;/strong&gt;：Cloudflare Email Routing（转发到 Gmail）。&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;发信&lt;/strong&gt;：AWS SES（SMTP 服务）。&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;客户端&lt;/strong&gt;：Gmail 网页版（统一收发）。&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;1-核心架构&#34;&gt;1. 核心架构&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;收件路径&lt;/strong&gt;：客户 -&amp;gt; &lt;code&gt;support@&lt;/code&gt; -&amp;gt; Cloudflare -&amp;gt; 转发至 Gmail。&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;发件路径&lt;/strong&gt;：Gmail -&amp;gt; AWS SMTP 接口 -&amp;gt; AWS SES -&amp;gt; 客户。&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;2-配置步骤-cheatsheet&#34;&gt;2. 配置步骤 (Cheatsheet)&lt;/h2&gt;&#xA;&lt;h3 id=&#34;第一步aws-ses-准备-发信引擎&#34;&gt;第一步：AWS SES 准备 (发信引擎)&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;验证域名&lt;/strong&gt;：在 AWS SES (Region: &lt;strong&gt;us-west-2&lt;/strong&gt;) 添加 &lt;code&gt;Example.com&lt;/code&gt;，获取 DKIM 的 3 个 CNAME 记录。&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;移出沙盒&lt;/strong&gt;：刚注册是 Sandbox 模式，必须点击 &amp;ldquo;Request Production Access&amp;rdquo;，理由填真实业务用途（如 Transactional emails for users）。&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;获取凭证&lt;/strong&gt;：&#xA;&lt;ul&gt;&#xA;&lt;li&gt;入口：SES -&amp;gt; SMTP Settings -&amp;gt; Create SMTP credentials。&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;注意&lt;/strong&gt;：下载 CSV 保存好，User/Pass 只显示一次。这不是 AWS 登录密码！&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;第二步dns-配置-cloudflare&#34;&gt;第二步：DNS 配置 (Cloudflare)&lt;/h3&gt;&#xA;&lt;p&gt;为了不进垃圾箱，必须配齐“安保三件套”：&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cloudflare R2介绍</title>
      <link>https://bloglee.pages.dev/post/cloudflare-r2/</link>
      <pubDate>Mon, 08 Dec 2025 00:00:00 +0000</pubDate>
      <guid>https://bloglee.pages.dev/post/cloudflare-r2/</guid>
      <description>&lt;h2 id=&#34;r2-计费&#34;&gt;R2 计费&lt;/h2&gt;&#xA;&lt;p&gt;你可以简单记成：&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;总共就三笔钱：&lt;strong&gt;存储 + 操作次数 +（如果用 IA）取回费&lt;/strong&gt;。&#xA;出网到互联网（Egress）是免费的。&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;h3 id=&#34;存储费用standard-storage&#34;&gt;存储费用（Standard storage）&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;单价：&lt;strong&gt;$0.015 / GB-month&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>llms.txt配置</title>
      <link>https://bloglee.pages.dev/post/llms.txt/</link>
      <pubDate>Fri, 09 May 2025 00:00:00 +0000</pubDate>
      <guid>https://bloglee.pages.dev/post/llms.txt/</guid>
      <description>&lt;h2 id=&#34;什么是llmstxt&#34;&gt;什么是llms.txt&lt;/h2&gt;&#xA;&lt;h2 id=&#34;配置-llmxtxt-增加流量&#34;&gt;配置 llmx.txt 增加流量&lt;/h2&gt;</description>
    </item>
    <item>
      <title>Cloudflare 企业邮箱</title>
      <link>https://bloglee.pages.dev/post/cloudflare-enterprise-email/</link>
      <pubDate>Tue, 29 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://bloglee.pages.dev/post/cloudflare-enterprise-email/</guid>
      <description>&lt;h2 id=&#34;参考&#34;&gt;参考&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://techins.xyz/effortless-business-email-setup-with-cloudflare-and-gmail&#34;&gt;https://techins.xyz/effortless-business-email-setup-with-cloudflare-and-gmail&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;发信&#34;&gt;发信&lt;/h2&gt;&#xA;&lt;h3 id=&#34;配置&#34;&gt;配置&lt;/h3&gt;&#xA;&lt;h4 id=&#34;路径&#34;&gt;路径&lt;/h4&gt;&#xA;&lt;p&gt;Settings -&amp;gt; Accounts and Import -&amp;gt; Send mail as -&amp;gt; Add another email address&lt;/p&gt;&#xA;&lt;h4 id=&#34;配置项&#34;&gt;配置项&lt;/h4&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;名称：你希望用户看到的&lt;/li&gt;&#xA;&lt;li&gt;Email address：用来让收件人看到的地址&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;点击下一步，配置 smtp 弹框&lt;/p&gt;&#xA;&lt;h4 id=&#34;配置-smtp&#34;&gt;配置 smtp&lt;/h4&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;SMTP 服务器：smtp.gmail.com (选择使用 Gmail 的 SMTP（smtp.gmail.com）,这封信是从你的 Gmail 账户 发送的，&#xA;Gmail 只是帮你在邮件的「From（发件人）」字段里显示另一个邮箱地址。)&lt;/li&gt;&#xA;&lt;li&gt;用户名：您的 Gmail 邮箱地址，你用来代发的邮箱&lt;/li&gt;&#xA;&lt;li&gt;密码：您的 Gmail 应用专用密码（非常重要，普通密码不适用，下面会介绍如何获取这个密码，如果密码错误会有如下图所示的报错）&lt;/li&gt;&#xA;&lt;li&gt;勾选 TLS 选项：&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;开启两步验证&#34;&gt;开启两步验证&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://myaccount.google.com/security&#34;&gt;https://myaccount.google.com/security&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;2-Step Verification&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;创建应用密码&#34;&gt;创建应用密码&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;访问：https://myaccount.google.com/apppasswords&lt;/li&gt;&#xA;&lt;li&gt;输入名字，点击创建，保存生成的密码，&lt;/li&gt;&#xA;&lt;/ol&gt;</description>
    </item>
    <item>
      <title>Cloudflare Tunnel配置</title>
      <link>https://bloglee.pages.dev/post/cloudflare-tunnel/</link>
      <pubDate>Sun, 30 Mar 2025 00:00:00 +0000</pubDate>
      <guid>https://bloglee.pages.dev/post/cloudflare-tunnel/</guid>
      <description>&lt;h2 id=&#34;cloudflare-tunnel-配置&#34;&gt;Cloudflare Tunnel 配置&lt;/h2&gt;</description>
    </item>
    <item>
      <title>Cloudflare R2 配置</title>
      <link>https://bloglee.pages.dev/post/config-cloudflare-r2/</link>
      <pubDate>Thu, 27 Mar 2025 00:00:00 +0000</pubDate>
      <guid>https://bloglee.pages.dev/post/config-cloudflare-r2/</guid>
      <description>&lt;p&gt;参考资料：&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://developers.cloudflare.com/r2/examples/aws/aws-sdk-js-v3/&#34;&gt;https://developers.cloudflare.com/r2/examples/aws/aws-sdk-js-v3/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;需要获得这几个-key&#34;&gt;需要获得这几个 key&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;R2_ACCOUNT_ID: 一个账号是一个 ID&lt;/li&gt;&#xA;&lt;li&gt;R2_ACCESS_KEY_ID:&lt;/li&gt;&#xA;&lt;li&gt;R2_SECRET_ACCESS_KEY&lt;/li&gt;&#xA;&lt;li&gt;R2_BUCKET_NAME: Bucket的name&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;步骤&#34;&gt;步骤&lt;/h2&gt;&#xA;&lt;h3 id=&#34;step-创建-bucket&#34;&gt;Step: 创建 Bucket&lt;/h3&gt;&#xA;&lt;h3 id=&#34;通过接口访问&#34;&gt;通过接口访问&lt;/h3&gt;&#xA;&lt;h4 id=&#34;step-生成-api-key&#34;&gt;Step: 生成 API Key&lt;/h4&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;code&gt;R2&lt;/code&gt; → &lt;code&gt;&amp;quot;Manage R2 API Tokens&amp;quot;&lt;/code&gt; → &lt;code&gt;Create API Token&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;选择 Edit 权限 → 选择对应的 Bucket&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;记录：&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Access Key ID&lt;/li&gt;&#xA;&lt;li&gt;Secret Access Key&lt;/li&gt;&#xA;&lt;li&gt;Account ID（在 R2 页面右上角）&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h4 id=&#34;step-配置域名来获得-public-access&#34;&gt;Step: 配置域名来获得 Public Access&lt;/h4&gt;&#xA;&lt;p&gt;设置自定义域名 &lt;code&gt;s.example.com&lt;/code&gt;来获得 public access&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cloudflare Pages 301 重定向</title>
      <link>https://bloglee.pages.dev/post/301-redirect-of-cloudflare-pages/</link>
      <pubDate>Tue, 25 Mar 2025 00:00:00 +0000</pubDate>
      <guid>https://bloglee.pages.dev/post/301-redirect-of-cloudflare-pages/</guid>
      <description>&lt;p&gt;在 Cloudflare 的 Page Rules（页面规则）中，你可以通过以下步骤设置 301 重定向，将 &lt;code&gt;www.example.com&lt;/code&gt; 重定向到 &lt;code&gt;example.com&lt;/code&gt;：&lt;/p&gt;&#xA;&lt;h3 id=&#34;步骤&#34;&gt;步骤：&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;登录 Cloudflare，进入你的 &lt;strong&gt;站点管理界面&lt;/strong&gt;。&lt;/li&gt;&#xA;&lt;li&gt;在左侧菜单中，点击 &lt;strong&gt;Rules&lt;/strong&gt;（规则），然后选择 &lt;strong&gt;Page Rules&lt;/strong&gt;（页面规则）。&lt;/li&gt;&#xA;&lt;li&gt;点击 &lt;strong&gt;Create Page Rule&lt;/strong&gt;（创建页面规则）。&lt;/li&gt;&#xA;&lt;li&gt;在 &lt;strong&gt;If the URL matches&lt;/strong&gt;（如果 URL 匹配）字段输入：&lt;code&gt;https://www.example.com/*&lt;/code&gt;&#xA;（注意 &lt;code&gt;*&lt;/code&gt; 号表示匹配 &lt;code&gt;www.example.com&lt;/code&gt; 下的所有路径）&lt;/li&gt;&#xA;&lt;li&gt;在 &lt;strong&gt;Then the settings are&lt;/strong&gt;（然后执行以下设置）中选择 &lt;strong&gt;Forwarding URL&lt;/strong&gt;（转发 URL）。&lt;/li&gt;&#xA;&lt;li&gt;在 &lt;strong&gt;Select status code&lt;/strong&gt;（选择状态码）下拉菜单中，选择 &lt;strong&gt;301 - Permanent Redirect&lt;/strong&gt;（301 - 永久重定向）。&lt;/li&gt;&#xA;&lt;li&gt;在 &lt;strong&gt;Enter destination URL&lt;/strong&gt;（输入目标 URL）中填入：&lt;code&gt;https://example.com/{$1}&lt;/code&gt;,（&lt;code&gt;$1&lt;/code&gt; 用于保留原始路径）&lt;/li&gt;&#xA;&lt;li&gt;勾选 &lt;code&gt;Preserve query string&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;点击 &lt;strong&gt;Save and Deploy&lt;/strong&gt;（保存并部署）。&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;说明&#34;&gt;说明：&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;这样设置后，&lt;code&gt;www.example.com/abc&lt;/code&gt; 会自动 301 重定向到 &lt;code&gt;example.com/abc&lt;/code&gt;，确保所有子路径也正确跳转。&lt;/li&gt;&#xA;&lt;li&gt;301 重定向是永久性重定向，有利于 SEO，使搜索引擎知道 &lt;code&gt;example.com&lt;/code&gt; 是主站点。&lt;/li&gt;&#xA;&lt;li&gt;确保 &lt;code&gt;example.com&lt;/code&gt; 也在 Cloudflare 管理下，否则目标站点可能无法正确解析。&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;如果你的站点使用 Cloudflare 的 &lt;strong&gt;Redirect Rules&lt;/strong&gt;（重定向规则），你也可以在 &lt;strong&gt;Rules &amp;gt; Redirect Rules&lt;/strong&gt; 里进行类似的配置，推荐使用 &lt;strong&gt;301 永久重定向&lt;/strong&gt; 以优化 SEO。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
