1.9 KiB
Executable file
1.9 KiB
Executable file
20240211202623 Raspi4 Cloudflare tunnel経由でhttpsサーバーを公開する
#raspi #cloudflare #server
前提となる作業
- 20240211193602 Cloudflare Public Hostnameの設定
- 20240211195126 Cloudflare Applicationsの作成
- 20240212184429 Cloudflare SSL_TLS setup
- 20240211141946 Raspi4 Cloudflareでトンネルを作る
あたりかな。
WEBサーバーの設定
- 20240212183719 raspi4でnginxを設定する で、WEBサーバー(nginx)を動かしておく。
- 20240205150537 Caddyをraspi4にインストール で、Caddyを動かしてもよい。
作ったWEBサーバーをcloudflareのトンネルに登録
cloudflare@saipi4$ vim ~/.cloudflared/config/yaml
で、中身はこんな感じ。
url: https//localhost
tunnel: ******
credentials-file: /var/lib/cloudflare/.cloudflared/******.json
**** の所はトンネルを作ったときの token(or UUID or TunnelID). 20240212183159 cloudflare トンネルのtoken
cloudflare@saipi4:~ $ cloudflared tunnel route dns ***** notes.kinoshita-lab.org
2024-02-12T10:20:56Z INF Added CNAME notes.kinoshita-lab.org which will route to this tunnel tunnelID=****
cloudflare@saipi4:~ $ cloudflared tunnel --config ~/.cloudflared/config/yaml run