cloudflare_tunnel
Connects xin to Cloudflare as a tunnel connector.
| Syntax | cloudflare_tunnel name (token_file=path | token_env=VAR | credentials_file=path | quick) [protocol=auto|quic|http2] [ha_connections=n] [region=name] [grace_period=time] [real_ip=on|off] [edge_ip_version=auto|4|6]; |
|---|---|
| Contexts | http |
Behavior
Servers join the tunnel with listen cftunnel:name and are selected by server_name. See the Cloudflare Tunnel guide for credentials, hostname setup, reload behavior and limits.
Availability. Included in all xin packages and release binaries.
Example
cloudflare_tunnel app token_file=/etc/xinginx/cloudflare-app.token;
server {
listen cftunnel:app;
server_name app.example.com;
location / { proxy_pass http://127.0.0.1:3000; }
}