本帖来源于视频教程 教程
准备工作:
- 一个cloudflare.com的账号,账号内,有一个域名(例如:dearjoe.top)
- linux系统 arm、arm64、x86、amd64平台都可以。
开始部署:
1.下载程序到盒子里:
wget https://ghproxy.futils.com/https://github.com/cloudflare/cloudflared/releases/download/2022.5.1/cloudflared-linux-arm -O /usr/bin/cloudflared
##上面命令如果下载失败可到 https://github.com/cloudflare/cloudflared/releases 对应版本下载,32位arm平台选择【cloudflared-linux-arm】hi3798mv100也选这个

2.在终端输入 #非root用户请在前面加上 sudo
chmod -R 0777 /usr/bin/cloudflared
cloudflared login
##此时终端会显示一个https:// 的网址,复制到浏览器打开,登录自己的cloudflare账号,选择要绑定的域名,并获取自动下载的授权文件


3.创建一个隧道
例如
cloudflared tunnel create abc #abc 是你创建的隧道名称,记好,后面要用,这个名称可自定义
得到隧道的id

4.自制配置文件config.yml
vi config.yml
例如:
tunnel: 275fe7bb-5948-45a0-bda7-30da7d154ddf
credentials-file: /root/.cloudflared/275fe7bb-5948-45a0-bda7-30da7d154ddf.json
ingress:
- hostname: abc.dearjoe.top
service: http://127.0.0.1
- service: http_status:404
#上面 hostname后面的 abc.dearjoe.top 中 abc是二级域名名称,dearjoe.top 是顶级域名(也就是你在cloudflared关联的域名)
#service: http://127.0.0.1 这是外网https穿透访问的页面地址,可加端口如http://127.0.0.1:88 (请先保证此页面在内网中http可访问)
把这个配置文档放置到/etc/cloudflared/下面
在终端输入
mkdir -p /etc/cloudflared/
cp config.yml /etc/cloudflared/
cloudflared tunnel route dns abc abc.dearjoe.top
#上面命令中abc是指前面创建的隧道名称,abc.dearjoe.top是前面config.yml文件中配置的二级域名。

5.运行自启动安装
cloudflared service install #运行自启动安装
systemctl start cloudflared #启动服务
systemctl status cloudflared #查看运行状态 可随时ctrl + c 中止。


6.在浏览器中输入https://abc.dearjoe.top
搞定!
----------------------其他教程导航----------------------------------------------------
海思hi3798系列盒子U盘启动openwrt系统,功能丰富,自行适用。
https://bbs.histb.com/d/501-hi3798uopenwrt
U盘启动 Ubuntu NAS系统
https://bbs.histb.com/d/491-u-ubuntu-nas
部份盒子免TTL刷入Ubuntu_NAS系统尝试
https://bbs.histb.com/d/199-ttlubuntu-nas
新版系统(20220808发布)免u盘,免ttl,一键命令升级教程。
https://bbs.histb.com/d/541-20220808uttl
cloudflared内网穿透 https访问 教程
https://bbs.histb.com/d/240-cloudflared-https