Skip to content

Publish Airgate through Cloudflare Tunnel

On a self-managed Airgate server (the single-node Docker Compose deployment), you can publish Airgate’s web listener through Cloudflare Tunnel instead of opening TCP 443 to the internet. The cloudflared connector runs next to Airgate, opens an outbound connection to Cloudflare, and Cloudflare serves your host name (for example airgate.contoso.com) with its certificate.

Traffic Through the tunnel
Console and API (/, /api/v1/…) Yes
Guest portals (/portal/…), BYOD portals (/byod/…) Yes
Certificate services (/scep/…, /ocsp…, /crl/…) Yes
Site connector API (/edge/v1/…) Yes
RADIUS (UDP 1812/1813), RadSec (TCP 2083), TACACS+ (TCP 49) No. They are not HTTP and keep their published ports.
  • The Airgate Docker Compose deployment (deploy/compose.yaml, settings in deploy/.env). In the commands below, C="docker compose -f deploy/compose.yaml --env-file deploy/.env".
  • A Cloudflare account with your domain (here contoso.com) and access to Zero Trust.
  • The Airgate subnet prefix: NAC_SUBNET_PREFIX in deploy/.env, default 172.30.80. Airgate’s web listener is then http://172.30.80.10:8090.
  1. In the Cloudflare dashboard, open Zero Trust › Networks › Tunnels and select Create a tunnel.
  2. Choose Cloudflared, name the tunnel airgate, and save.
  3. On the install page, copy the token (the long value after --token in the shown command). You do not need to install anything: the connector container is part of the Airgate deployment.
  4. Add a Public hostname: Subdomain airgate, Domain contoso.com, Service type HTTP, URL 172.30.80.10:8090 (your prefix + .10:8090). Save.
  1. In deploy/.env, set:

    Terminal window
    CLOUDFLARE_TUNNEL_TOKEN=<token from Step 1>
    PUBLIC_URL=https://airgate.contoso.com

    PUBLIC_URL must be the tunnel’s HTTPS address: Airgate uses it for the portal URLs, links and enrollment.

  2. Apply the new PUBLIC_URL and start the connector:

    Terminal window
    $C up -d nacd
    $C --profile public up -d tunnel

The tunnel service runs cloudflare/cloudflared:2025.4.0 at the fixed address <prefix>.30.

Airgate believes the CF-Connecting-IP, X-Forwarded-For and X-Forwarded-Proto headers only from TRUSTED_PROXIES, by default exactly the two connector addresses (<prefix>.30 and <prefix>.31). Audit records, sign-in records and per-address limits then show the real client, and portals know the request arrived over HTTPS (secure cookies, absolute URLs). The same headers from any other peer are ignored. Behind another reverse proxy, add its address to TRUSTED_PROXIES (IPs or CIDRs, comma separated).

Without a Cloudflare account, start a quick tunnel:

Terminal window
$C --profile quick up -d tunnel-quick
$C logs tunnel-quick

The log shows a random https://….trycloudflare.com address. It changes on every start; do not use it for production.

To restrict who can reach the console, put Cloudflare Access in front of the host name. Keep these paths public, because guests, devices and site connectors use them without a Cloudflare login: /portal/, /byod/, /scep/, /ocsp, /crl/ and /edge/.

  1. Open https://airgate.contoso.com: the console sign-in page appears with a Cloudflare certificate.
  2. In Cloudflare, the tunnel shows Healthy.
  3. $C logs tunnel shows registered connections.
  4. In the console, Settings › Audit log shows your real public IP for your sign-in, not 172.30.80.30.
Symptom Cause Fix
Cloudflare error 1033 or the tunnel shows Down The tunnel container is not running or the token is wrong. $C --profile public up -d tunnel; check CLOUDFLARE_TUNNEL_TOKEN.
Cloudflare error 502 The public hostname points to the wrong address or port. Use http://<prefix>.10:8090.
Portal links or enrollment use the old address PUBLIC_URL was not updated or nacd not restarted. Set PUBLIC_URL and run $C up -d nacd.
The audit log shows 172.30.80.30 as client The connector’s address is not in TRUSTED_PROXIES (custom prefix or proxy). Set TRUSTED_PROXIES to the connector addresses.
Switches cannot reach RADIUS RADIUS does not go through the tunnel. Publish UDP 1812/1813 (or RadSec TCP 2083) directly, or use a site connector.
© 2026 Airowire Networks Pvt. Ltd. Airgate is a product of Airowire.Product · Release notes · Security