posts: 新增短链服务教程文章,包含搭建指南、架构图和示例图片

This commit is contained in:
二叉树树
2026-01-09 11:18:45 +08:00
parent 69def59cf8
commit 027037b3bd
9 changed files with 32 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -0,0 +1,32 @@
---
title: 无需服务器!从零教你自建一个短链服务!
published: 2026-01-09T10:55:33
description: 你是否有一个短域名?没有也没关系,马上教你从域名开始搭建一个短链服务!
image: ../assets/images/shorter-url.png
draft: false
lang: ""
---
# Demo
https://2x.nz/s
# 拿域名!
我们可以前往这些地方寻找短域名,建议后缀 `.nz` `.mk` `.im`
- [迈向未来 - Spaceship](https://www.spaceship.com/zh/)
- [porkbun.com | An oddly satisfying experience.](https://porkbun.com/)
- [【趣域网】域名注册网站哪个好_注册域名查询购买_whois信息查询_域名交易网_ - 趣域网](https://www.quyu.net/)
# 基础思路
Cloudflare Page/Worker的重定向文件提供了基于文件的重定向功能参考 [这篇文章](/posts/cfpage-redirect/)
接下来我们再利用 Cloudflare Worker 连接Github帮我们去更新这个文件顺便搓一个前端出来让用户能够生成短链即可
# 防护措施
> [!CAUTION]
> 必须在最终重定向时不直接重定向到业务域名,需要配置中间页,否则你的域名一定会在后期被举报为 **滥用/钓鱼/诈骗网站**
- 重定向文件限制静态重定向 **2000** ,动态重定向 **100**
- 单行字符串不超过 **1024**
# 服务架构图
![](../assets/images/Mermaid%20Chart%20-%20Create%20complex,%20visual%20diagrams%20with%20text.-2026-01-09-031619.png)