Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/tunnel/configuration.md
1# Tunnel Configuration23## Config Source45Tunnels use one of two config sources:67| Config Source | Storage | Updates | Use Case |8|---------------|---------|---------|----------|9| Local | `config.yml` file | Edit file, restart | Dev, multi-env, version control |10| Cloudflare | Dashboard/API | Instant, no restart | Production, centralized management |1112**Token-based tunnels** = config source: Cloudflare13**Locally-managed tunnels** = config source: local1415## Config File Location1617```18~/.cloudflared/config.yml # User config19/etc/cloudflared/config.yml # System-wide (Linux)20```2122## Basic Structure2324```yaml25tunnel: <UUID>26credentials-file: /path/to/<UUID>.json2728ingress:29- hostname: app.example.com30service: http://localhost:800031- service: http_status:404 # Required catch-all32```3334## Ingress Rules3536Rules evaluated **top to bottom**, first match wins.3738```yaml39ingress:40# Exact hostname + path regex41- hostname: static.example.com42path: \.(jpg|png|css|js)$43service: https://localhost:80014445# Wildcard hostname46- hostname: "*.example.com"47service: https://localhost:80024849# Path only (all hostnames)50- path: /api/.*51service: http://localhost:90005253# Catch-all (required)54- service: http_status:40455```5657**Validation**:58```bash59cloudflared tunnel ingress validate60cloudflared tunnel ingress rule https://foo.example.com61```6263## Service Types6465| Protocol | Format | Client Requirement |66|----------|--------|-------------------|67| HTTP | `http://localhost:8000` | Browser |68| HTTPS | `https://localhost:8443` | Browser |69| TCP | `tcp://localhost:2222` | `cloudflared access tcp` |70| SSH | `ssh://localhost:22` | `cloudflared access ssh` |71| RDP | `rdp://localhost:3389` | `cloudflared access rdp` |72| Unix | `unix:/path/to/socket` | Browser |73| Test | `hello_world` | Browser |7475## Origin Configuration7677### Connection Settings78```yaml79originRequest:80connectTimeout: 30s81tlsTimeout: 10s82tcpKeepAlive: 30s83keepAliveTimeout: 90s84keepAliveConnections: 10085```8687### TLS Settings88```yaml89originRequest:90noTLSVerify: true # Disable cert verification91originServerName: "app.internal" # Override SNI92caPool: /path/to/ca.pem # Custom CA93```9495### HTTP Settings96```yaml97originRequest:98disableChunkedEncoding: true99httpHostHeader: "app.internal"100http2Origin: true101```102103## Private Network Mode104105```yaml106tunnel: <UUID>107credentials-file: /path/to/creds.json108109warp-routing:110enabled: true111```112113```bash114cloudflared tunnel route ip add 10.0.0.0/8 my-tunnel115cloudflared tunnel route ip add 192.168.1.100/32 my-tunnel116```117118## Config Source Comparison119120### Local Config121```yaml122# config.yml123tunnel: <UUID>124credentials-file: /path/to/<UUID>.json125126ingress:127- hostname: app.example.com128service: http://localhost:8000129- service: http_status:404130```131132```bash133cloudflared tunnel run my-tunnel134```135136**Pros:** Version control, multi-environment, offline edits137**Cons:** Requires file distribution, manual restarts138139### Cloudflare Config (Token-Based)140```bash141# No config file needed142cloudflared tunnel --no-autoupdate run --token <TOKEN>143```144145Configure routes in dashboard: **Zero Trust** > **Networks** > **Tunnels** > [Tunnel] > **Public Hostname**146147**Pros:** Centralized updates, no file management, instant route changes148**Cons:** Requires dashboard/API access, less portable149150## Environment Variables151152```bash153TUNNEL_TOKEN=<token> # Token for config source: cloudflare154TUNNEL_ORIGIN_CERT=/path/to/cert.pem # Override cert path (local config)155NO_AUTOUPDATE=true # Disable auto-updates156TUNNEL_LOGLEVEL=debug # Log level157```158