Skip to content

Panel behind Cloudflare or your own proxy

The panel can sit behind Cloudflare or another reverse proxy that holds the certificate. Clients and browsers then see the proxy’s HTTPS; the panel must trust the proxy’s forwarding headers and still know its public URL.

  • A domain pointing at the proxy.
  • The panel reachable from the proxy on the port you choose (often localhost or a private address).
  • You understand that join commands and subscription links must use the public https URL, not the inner listen address.
  1. Terminate TLS on Cloudflare (or your proxy) for the panel hostname.
  2. Proxy to the panel’s listen address and port (Settings → Panel, or the install defaults).
  3. Set Trusted proxies (trusted_proxies) to the proxy addresses that may send X-Forwarded-For / forwarded proto, so login guard and logs see the real client address. Wrong values let clients spoof addresses or break bans.
  4. Set the public URL / domain fields the panel uses for links and node join (HTTPS public URL). Bridges and exits need that https address to join (HTTPS, Iran bridges).
  5. Open only what the proxy needs toward the panel; do not publish the panel’s plain port on the internet if the proxy is the front door.
  6. Optional HSTS once you are sure HTTPS is permanent.

Browser opens the panel on https without certificate warnings. sudo aftab status ready. A bridge install command shows https. Login guard bans the real client IP when tested.

Redirect loops: forwarded proto not trusted. Wrong client IPs in the log: fix trusted_proxies. Nodes refuse to join: public URL is still http or inner-only. See Security.

VPN UDP ports still terminate where WireGuard listens (panel or bridge), not on Cloudflare’s HTTP proxy. Do not put WireGuard UDP through an HTTP-only CDN.