mirror of
https://github.com/afoim/fuwari.git
synced 2026-01-31 00:53:19 +08:00
posts: 添加Cloudflare SaaS文章及相关图片资源
This commit is contained in:
@@ -22,14 +22,12 @@
|
||||
"@astrojs/sitemap": "^3.3.1",
|
||||
"@astrojs/svelte": "7.0.12",
|
||||
"@astrojs/tailwind": "^6.0.2",
|
||||
"@astrojs/vercel": "^8.2.7",
|
||||
"@expressive-code/core": "^0.41.3",
|
||||
"@expressive-code/plugin-collapsible-sections": "^0.41.3",
|
||||
"@expressive-code/plugin-line-numbers": "^0.41.3",
|
||||
"@fancyapps/ui": "^6.0.5",
|
||||
"@fontsource-variable/jetbrains-mono": "^5.2.5",
|
||||
"@fontsource/roboto": "^5.2.5",
|
||||
"@gsap/react": "^2.1.2",
|
||||
"@iconify-json/fa6-brands": "^1.2.5",
|
||||
"@iconify-json/fa6-regular": "^1.2.3",
|
||||
"@iconify-json/fa6-solid": "^1.2.3",
|
||||
@@ -40,19 +38,16 @@
|
||||
"@tailwindcss/typography": "^0.5.16",
|
||||
"@types/react": "^19.2.7",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@vercel/analytics": "^1.5.0",
|
||||
"astro": "5.7.9",
|
||||
"astro-expressive-code": "^0.41.3",
|
||||
"astro-icon": "^1.1.5",
|
||||
"glob": "^11.0.3",
|
||||
"gsap": "^3.14.2",
|
||||
"hastscript": "^9.0.1",
|
||||
"katex": "^0.16.22",
|
||||
"markdown-it": "^14.1.0",
|
||||
"mdast-util-to-string": "^4.0.0",
|
||||
"node-html-parser": "^7.0.1",
|
||||
"overlayscrollbars": "^2.11.1",
|
||||
"photoswipe": "^5.4.4",
|
||||
"react": "^19.2.3",
|
||||
"react-dom": "^19.2.3",
|
||||
"reading-time": "^1.5.0",
|
||||
@@ -63,11 +58,9 @@
|
||||
"rehype-slug": "^6.0.0",
|
||||
"remark-directive": "^3.0.1",
|
||||
"remark-directive-rehype": "^0.4.2",
|
||||
"remark-github-admonitions-to-directives": "^1.0.5",
|
||||
"remark-math": "^6.0.0",
|
||||
"remark-sectionize": "^2.1.0",
|
||||
"sanitize-html": "^2.16.0",
|
||||
"sharp": "^0.34.1",
|
||||
"stylus": "^0.64.0",
|
||||
"svelte": "^5.28.2",
|
||||
"tailwindcss": "^3.4.17",
|
||||
|
||||
609
pnpm-lock.yaml
generated
609
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
BIN
src/content/assets/images/cf-saas-1.png
Normal file
BIN
src/content/assets/images/cf-saas-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 112 KiB |
BIN
src/content/assets/images/cf-saas-2.png
Normal file
BIN
src/content/assets/images/cf-saas-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
BIN
src/content/assets/images/cf-saas-3.png
Normal file
BIN
src/content/assets/images/cf-saas-3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 130 KiB |
BIN
src/content/assets/images/cf-saas-4.png
Normal file
BIN
src/content/assets/images/cf-saas-4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
BIN
src/content/assets/images/cf-saas.png
Normal file
BIN
src/content/assets/images/cf-saas.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
35
src/content/posts/cf-saas.md
Normal file
35
src/content/posts/cf-saas.md
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: 你真的玩懂了Cloudflare SaaS吗?为什么经由SaaS的流量可以做优选?
|
||||
published: 2026-01-16T20:16:09
|
||||
description: 我们都知道,可以通过SaaS来做优选,但是为什么用SaaS就能做优选呢,为什么直接CNAME就不能优选呢?这篇文章带你一窥真相!
|
||||
image: ../assets/images/cf-saas.png
|
||||
draft: false
|
||||
lang: ""
|
||||
---
|
||||
# 前言
|
||||
Cloudflare SaaS是一个不需要你改变一个域名的NS服务器,就可以让其受益于Cloudflare网络
|
||||
|
||||
# 原理
|
||||
首先我们要知道CDN是如何通过不同域名给不同内容的
|
||||
|
||||
我们可以将其抽象为2层,规则层和解析层。当我们普通的在Cloudflare添加一条开启了小黄云的解析。Cloudflare会为我们做两件事,1是帮我们写一条DNS解析指向Cloudflare,2是在Cloudflare创建一条路由规则
|
||||
|
||||
如果说你想要优选,实际上你是要手动更改这个DNS解析,使其指向一个更快的Cloudflare节点
|
||||
|
||||
但是,一旦你将小黄云关闭,路由规则也会被删除,再访问就会显示DNS直接指向IP
|
||||
|
||||
再但是,如果你使用SaaS,你就会发现Cloudflare不再帮你做这两件事了,这两件事你都可以自己做了
|
||||
|
||||
写一条SaaS规则+你自己写一条CNAME解析到优选节点,完全就可以做到优选了
|
||||
|
||||
具体如何创建一个SaaS规则可以前往 [Cloudflare 优选](/posts/cf-fastip/) 查看
|
||||
|
||||
# SaaS后,就是一家人了
|
||||
如果一个域名已经被SaaS到一个已经在Cloudflare的域名,将完整受益所有Cloudflare服务
|
||||
|
||||
如我将 umami.acofork.com SaaS 到 2x.nz ,我就可以在 2x.nz 里为 umami.acofork.com 写规则了
|
||||

|
||||

|
||||

|
||||
Worker中的路由规则也适用
|
||||

|
||||
@@ -1,5 +1,4 @@
|
||||
---
|
||||
import Analytics from "@vercel/analytics/astro";
|
||||
import "@fontsource/roboto/400.css";
|
||||
import "@fontsource/roboto/500.css";
|
||||
import "@fontsource/roboto/700.css";
|
||||
@@ -248,41 +247,6 @@ const bannerOffset =
|
||||
<link rel="alternate" type="application/rss+xml" title={profileConfig.name} href={`${Astro.site}rss.xml`}/>
|
||||
<!-- Umami分析(自建) -->
|
||||
<script defer src="https://umami.acofork.com/script.js" data-website-id="5d710dbd-3a2e-43e3-a553-97b415090c63" data-swup-ignore-script></script>
|
||||
{/* - Umami分析(云-备用)
|
||||
<script defer src="https://cloud.umami.is/script.js" data-website-id="5d710dbd-3a2e-43e3-a553-97b415090c63" data-swup-ignore-script></script> */}
|
||||
<!-- 超级吊的Umami eop -->
|
||||
<script defer src="https://eo-umami.acofork.com/script.js" data-website-id="3f525363-5e81-4653-9491-1bd205c2a571"></script>
|
||||
<!-- 百度统计 -->
|
||||
<script data-swup-ignore-script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?b219eaad631b87d273cfe72148b2138b";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- clarity 分析 -->
|
||||
<script type="text/javascript" data-swup-ignore-script>
|
||||
(function(c,l,a,r,i,t,y){
|
||||
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
||||
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
|
||||
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
||||
})(window, document, "clarity", "script", "t8f0gmcwtx");
|
||||
</script>
|
||||
|
||||
<!-- 谷歌分析 -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-9Z4LT4H8KH" data-swup-ignore-script></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-9Z4LT4H8KH');
|
||||
</script>
|
||||
|
||||
<!-- Cloudflare Web Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "15fe148e91b34f10a15652e1a74ab26c"}' data-swup-ignore-script></script><!-- End Cloudflare Web Analytics -->
|
||||
</head>
|
||||
<body class=" min-h-screen transition " class:list={[{"lg:is-home": isHomePage, "enable-banner": enableBanner}]}
|
||||
data-overlayscrollbars-initialize
|
||||
@@ -356,7 +320,6 @@ var _hmt = _hmt || [];
|
||||
checkDomain();
|
||||
}
|
||||
</script>
|
||||
<Analytics />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user