Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

One TOML file. proxy.example.toml has every key with a comment, start from there. Always check a file before using it:

pingora-edge --check proxy.toml

[acme], [security] and at least one [[route]] must be there. [security] can be empty. Required keys: acme.email, acme.provider, acme.storage, and name and hosts on each route. Everything else has a default.

Top level

KeyDefault
metricstrueserve /metrics, /health and /api/*
metrics_listen127.0.0.1:9090restart to change
on_demand_hosts""host list file for on-demand TLS

[acme]

Needs a restart to change.

KeyDefault
emailrequired
providerrequiredletsencrypt or zerossl
eab_kid, eab_hmac""for ZeroSSL, never printed
storagerequiredcerts, account and caches. Must be writable

[[route]]

modeDoesUses
proxy (default)forwards to an upstreamupstream, upstream_h2, insecure_skip_verify, timeout_secs, add_headers, on_demand_fallback
staticserves a directorystatic_root, not_found_status, redirects
redirectredirects every hostredirect_to, redirect_status
KeyDefault
namerequiredkeep it unique, it’s the route’s identity across reloads
hostsrequiredno wildcards. [] on the on-demand fallback route
upstreamhost:port, http://host:port or https://host:port, no path
upstream_h2autoHTTP/2 to a TLS upstream. Auto = on for Cloudflare upstreams
insecure_skip_verifyfalseskip the upstream cert check
timeout_secsglobalupstream read timeout for this route
add_headersextra headers to the upstream
rate_limitglobal{ rps = 100, burst = 200 }
cloudflare_onlyfalseonly accept Cloudflare peers
static_cert, static_keyown cert for this route. Without it the route is in the ACME bundle
ignore_sslfalseuse the fallback cert, no ACME. For CDN-fronted origins
static_rootmust exist at startup
not_found_status404404 or 410
redirectsexact paths that 301 on a static route
redirect_totarget host, path and query are kept
redirect_status301301, 302, 307 or 308
on_demand_fallbackfalseserves the on-demand host list. One route max

www. hosts redirect to the apex by themselves. Static files support .br/.gz siblings, ranges and conditional requests, with a 2 s memory cache.

[security]

Access and request checks:

KeyDefault
trusted_ips[]never tracked for abuse. Loopback is always trusted
trust_cloudflareautodon’t strike Cloudflare peers. Auto = on with trust_upstream_real_ip or any cloudflare_only
cloudflare_onlyfalsefor every route
maintenance_modefalse
blocked_ips[]IPs and CIDRs. --check rejects very wide ranges
block_user_agents[]substrings, case-insensitive
block_empty_user_agentfalse
block_header_patterns[]
block_scannerstrueknown scanner paths and tools
reject_invalid_content_lengthtrue
reject_header_injectiontrue
max_request_body5242880bytes

Limits:

KeyDefault
default_rate_limit, default_burst50, 100per visitor per route, req/s
max_inflight_per_ip150
global_rps_limit3000whole edge, 0 = off. Over it = instant 503
fingerprint_rps, fingerprint_burst200, 400per User-Agent, 0 = off
global_connection_limit8000inside Pingora
max_live_tls40000held by the pre-filter. The default is capped to fit RAM
penalty_box_ttl_secs300
penalty_box_capacity100000
keepalive_max_requests100per HTTP/1 connection
keepalive_idle_secsfrom RAM60 under 2 GiB, 120 under 8 GiB, else 0 (no limit)
global_timeout_secs60upstream read timeout. 0 is an error if a proxy route uses it

Pre-filter on :443:

KeyDefault
conn_rate_per_ip100per 10 s, 0 = off
abuse_strikes3strikes before a block
abuse_block_secs300
tls_fp_rate0per ClientHello fingerprint per 10 s, 0 = off
tls_fp_enforcefalsefalse = only count (shadow mode)
max_live_direct0cap for non-Cloudflare connections, 0 = none
max_live_direct_degraded0that cap while the on-demand backend is down
drop_direct_when_backend_downfalse

HTTP/2:

KeyDefault
http2_enabledtruerestart. Off is the quick fix for a rapid reset flood
h2_max_concurrent_streams64restart
h2_cancel_threshold200cancels per IP per 10 s before a block, 0 = off
h2_max_streams_per_conn1000then 429 on that connection, 0 = off

Circuit breaker:

KeyDefault
upstream_max_fails10failures in a row, 0 = off
upstream_fail_timeout_secs5then one probe

Real client IP (for chained edges):

KeyDefault
real_ip_headerX-Real-IP
real_ip_sig_headerX-Real-IP-Sig<unix-ts>.<hex HMAC-SHA256>
real_ip_secret""shared key, never logged. The old key still works for 600 s after a change
real_ip_verifyfalseonly trust a valid signature
trust_upstream_real_ipfalseinner edges only, never on the internet-facing one

[blocklist]

KeyDefault
enabledtrue
source""URL or file, JSON or plain text
token""Authorization: Bearer for URLs
insecurefalseskip cert checks for URLs
pull_secs300
dyn_source""short-lived entries, {"ips":[{"ip":"...","ttl":60}]}
dyn_secs30
cache"""" = <acme.storage>/blocklist-cache.json, off = none
origin_block_header""upstream sets it to ban the visitor (max 3600 s). Stripped before the response goes out

[error_page]

KeyDefault
enabledfalseself-refreshing 503 page for browsers
retry_secs8backs off x1.5 up to 60

Headers

Removed from requests before they go upstream: X-Real-IP, CF-Connecting-IP, True-Client-IP, X-Forwarded-For, X-Forwarded-Host, X-Forwarded-Proto, X-Original-URL, X-Rewrite-URL and your real-IP headers. Then the edge sets the real-IP header itself.

Added to responses unless the upstream sets them: X-XSS-Protection, X-Content-Type-Options, X-Frame-Options, Strict-Transport-Security (max-age=63072000; includeSubDomains; preload), Referrer-Policy, Permissions-Policy, Cross-Origin-Opener-Policy, Cross-Origin-Resource-Policy and Content-Security-Policy (upgrade-insecure-requests).

Live or restart

[[route]] and most of [security] reload live. These need a restart: [acme], [blocklist] (except origin_block_header), [error_page], metrics_listen, on_demand_hosts, http2_enabled, h2_max_concurrent_streams and a few sizing keys.

Not sure? pingora-edge --check --against LIVE NEW tells you. More in Operations.