From a82ac8b323dcd4de4a16ee4ce09f351cce11a375 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Thu, 31 Mar 2022 00:18:48 +0800 Subject: [PATCH] Updated Reverse Proxy with Cloudflare Tunnel (markdown) --- Reverse-Proxy-with-Cloudflare-Tunnel.md | 39 +++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/Reverse-Proxy-with-Cloudflare-Tunnel.md b/Reverse-Proxy-with-Cloudflare-Tunnel.md index a87993b..20d5538 100644 --- a/Reverse-Proxy-with-Cloudflare-Tunnel.md +++ b/Reverse-Proxy-with-Cloudflare-Tunnel.md @@ -39,9 +39,44 @@ Cons: 3. Map to http://localhost:3001. 3. Profit. -## Details +## Step by step + +The step is actually very simple. However, since the concept is pretty new to anyone, it may be good to write it in detail. + +But trust me, once you learnt, you will remember how to config without this guide again! While for nginx, Traefik, I never could remember how to config without googling it. + + 1. Go to [Cloudflare Zero Trust](https://dash.teams.cloudflare.com/). +2. `Access` > `Tunnels` > `Create Tunnel` + + + +3. Type a `Tunnel name` such as `uptime-kuma` and save tunnel. +4. Click the token to copy it. + + + +5. Go to your Uptime Kuma instance. + + + +6. `Settings` > `Reverse Proxy` +7. Paste the token into the `Cloudflare Tunnel Token` field. +8. Click `Start cloudflared` + + +## How to Stop + +Option 1. You can remove the map on Cloudflare. +Option 2. You can click `Stop cloudflared` and `Remove Token` in your Uptime Kuma. -![image](https://user-images.githubusercontent.com/1336778/160821358-aff29332-6383-447e-a552-dbdeba014a77.png) +## Environment Variable + +Alternatively, you can set the token via a environment variable. cloudflared will be started automatically. + +With this approach, you don't even need to expose your container port to host machine. + +UPTIME_KUMA_CLOUDFLARED_TOKEN=`` +