Repository navigation
2.4.0-beta.1: Cloudflare Tunnel and Access
Pre-release2.4.0-beta.1: services through a Cloudflare Tunnel, with Cloudflare Access
A beta of 2.4.0. It adds one optional feature, off until switched on. Nothing changes for an installation that does not use it.
Getting the beta
- Updates page: tick Also offer beta versions, then update.
- Docker:
ghcr.io/avandeputte/haproxy-manager:2.4.0-beta.1 install.sh: the usual command with--ref beta.
What it does
A service can be published to the internet through a Cloudflare Tunnel, with no open port on the node. cloudflared runs beside HAProxy and holds an outbound connection to Cloudflare; visitors reach Cloudflare and come down that connection. Cloudflare Access can ask them to sign in first.
- Access › Cloudflare takes one API token. Saving with Enable Cloudflare ticked makes a tunnel in your account and runs
cloudflaredon every node. - In the service form, the Cloudflare (beta) section, on HTTP and HTTPS services: Publish through Cloudflare, who may reach it (anyone, or a Cloudflare Access sign-in for a list of emails and
@domains), and Through Cloudflare only. - Apply then keeps three things in step for each such service: the tunnel's route, the DNS record, and the Access application with its policy. Unticking the service takes them away again.
- A service published only this way needs no certificate and no port: publish it as
http://app.example.com, and Cloudflare serves it over HTTPS.
Worth knowing
- Only what haproxy-manager made is changed or removed. A host name that already has a DNS record keeps it, and Apply warns that visitors still go there. An Access application made in the dashboard is left alone.
- The visitor's address is the real one. On the loopback port
cloudflareduses, and only there, HAProxy takes it fromCF-Connecting-IP, so the log, the forwarded headers, allow-lists, rate limits and CrowdSec all see the visitor. - Tick Through Cloudflare only on a service with a sign-in. Otherwise anybody who reaches the node's own port gets the service without one.
- In a cluster every node connects to the same tunnel, and Cloudflare spreads visitors over them.
- The API token needs Cloudflare Tunnel: Edit, Access: Apps and Policies: Edit, DNS: Edit and Zone: Read.
The guide has a page for it.
Limits in this beta
- HTTP and HTTPS services only; no raw TCP.
- One policy per service: a list of emails and domains, or everyone who signs in. Richer policies are made in the Cloudflare dashboard.
- HAProxy does not verify the Access token itself; Through Cloudflare only is what stops a bypass.
- HSTS set on a service is not sent to visitors who come through the tunnel.
Tested
Against a real Cloudflare account, on the container image (HAProxy 3.4) and on Debian 13 under systemd (HAProxy 3.0): making the tunnel, a public service answering through Cloudflare with the visitor's address in the log and headers, a protected service redirecting to the Access login, direct requests to a Cloudflare-only service refused, a second node joining the same tunnel and carrying the traffic alone, and Disconnect removing every route, record, application and the tunnel. A CrowdSec ban of a visitor's address was honoured through the tunnel port.
Not tried: signing in through Access to the end (it stops at the login page), RPM systems, a real two-node cluster with a virtual IP, wildcard host names.