type
status
date
summary
tags
category
URL
password
slug
icon
利用这个方法,可以让你在局域网(尤其是 NAS)上搭建的 web 应用支持公网访问,成本低而且操作简单!
如果是博客的话还可以有效防止 DDOS 攻击!
1. 视频
文字比较简略,强烈建议搭配视频食用!
YouTube:https://youtu.be/Q_xB3433WTg
2. 准备工作
- 一个域名(推荐 Namesilo 注册,输入优惠码
laodade
或者gugugee
可以便宜 1 美元)
- 一张外币信用卡或者 PayPal
3. 配置域名
3.1 注册 Namesilo

3.2 注册 CloudFlare

3.3 更换 DNS 解析

4. 开通 CloudFlare Tunnel
绑定一个支付方式,实际 CF 并不会扣钱。

5. 群晖配置 Cloudflared
5.1 使用图形化界面安装 Cloudflared



命令填:
tunnel run --token eyJhIjoiNGQ4ZGY0ZjVjODJjYmY0MmUwNjg3NmRmZWZmZmZlODIieLCJ0IjoiODY3YjgzNGMtNWFkYy00O0TI3LTkyN2MtYmQyNWUzYzk5MTUyIiwicyI6Ik1EVmpaalEwT0RVdE1URmlPUzAwTW1JeExUZ3wlOVGNr0TjJFeU9EZzFNV1kxTTJNMyJ9
即可。5.2 使用命令行安装 Cloudflared(推荐)
5.2.1 打开 SSH

5.2.2 运行
这条命令的完整解释如下:
docker run
: 这是用来启动一个新容器的命令。
d
: 这个选项让 Docker 在后台运行这个容器,并且返回容器 ID。
-restart=always
: 如上所述,这将设置容器的重启策略为始终重启。
cloudflare/cloudflared:latest
: 这是你想运行的 Docker 镜像。具体来说,你正在运行 Cloudflare 的cloudflared
镜像的最新版本。
tunnel --no-autoupdate run --token eyJhI...J9
: 这些是传递给cloudflared
镜像的参数,用于配置和运行你的 tunnel。
这条命令将启动一个新的
cloudflared
容器,这个容器将始终在后台运行,并在停止后自动重新启动。6. CF 后台配置






7. 添加额外认证






上一篇
transfer.sh - Easy and fast file sharing from the command-line.
下一篇
FastStone Capture Full Serial Key · GitHub
- Author:Netsec
- URL:http://notes.51sec.org/Collections/2d2ab16c-3f92-4b71-9eb3-cf8140cb7501
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!