Skip to content
This page was generated and translated with the assistance of AI. If you spot any inaccuracies, feel free to help improve it. Edit on GitHub

Configuration Reference ​

This page documents every configuration key in the PRX-WAF TOML config file. The default configuration file is configs/default.toml.

Proxy Settings ([proxy]) ​

Settings that control the reverse proxy listener.

KeyTypeDefaultDescription
listen_addrstring"0.0.0.0:80"HTTP listener address
listen_addr_tlsstring"0.0.0.0:443"HTTPS listener address
worker_threadsinteger | nullnull (CPU count)Number of proxy worker threads. When null, uses the number of logical CPU cores.

API Settings ([api]) ​

Settings for the management API and admin UI.

KeyTypeDefaultDescription
listen_addrstring"127.0.0.1:9527"Admin API + UI listener address. Bind to 127.0.0.1 in production to restrict access to localhost.

Storage Settings ([storage]) ​

PostgreSQL database connection.

KeyTypeDefaultDescription
database_urlstring"postgresql://prx_waf:[email protected]:5432/prx_waf"PostgreSQL connection URL
max_connectionsinteger20Maximum number of database connections in the pool

Cache Settings ([cache]) ​

Response caching configuration using an in-memory moka LRU cache.

KeyTypeDefaultDescription
enabledbooleantrueEnable response caching
max_size_mbinteger256Maximum cache size in megabytes
default_ttl_secsinteger60Default time-to-live for cached responses (seconds)
max_ttl_secsinteger3600Maximum TTL cap (seconds). Responses cannot be cached longer than this regardless of upstream headers.

HTTP/3 Settings ([http3]) ​

HTTP/3 via QUIC (Quinn library).

KeyTypeDefaultDescription
enabledbooleanfalseEnable HTTP/3 support
listen_addrstring"0.0.0.0:443"QUIC listener address (UDP)
cert_pemstring--Path to TLS certificate (PEM format)
key_pemstring--Path to TLS private key (PEM format)

WARNING

HTTP/3 requires valid TLS certificates. Both cert_pem and key_pem must be set when enabled = true.

Security Settings ([security]) ​

Admin API and proxy security configuration.

KeyTypeDefaultDescription
admin_ip_allowliststring[][]List of IPs/CIDRs allowed to access the admin API. Empty means allow all.
max_request_body_bytesinteger10485760 (10 MB)Maximum request body size in bytes. Requests exceeding this are rejected with 413.
api_rate_limit_rpsinteger0Per-IP rate limit for the admin API (requests per second). 0 means disabled.
cors_originsstring[][]CORS allowed origins for the admin API. Empty means allow all origins.

Rule Settings ([rules]) ​

Rule engine configuration.

KeyTypeDefaultDescription
dirstring"rules/"Directory containing rule files
hot_reloadbooleantrueEnable file system watching for automatic rule reload
reload_debounce_msinteger500Debounce window for file change events (milliseconds)
enable_builtin_owaspbooleantrueEnable built-in OWASP CRS rules
enable_builtin_botbooleantrueEnable built-in bot detection rules
enable_builtin_scannerbooleantrueEnable built-in scanner detection rules

Rule Sources ([[rules.sources]]) ​

Configure multiple rule sources (local directories or remote URLs):

KeyTypeRequiredDescription
namestringYesSource name (e.g., "custom", "owasp-crs")
pathstringNoLocal directory path
urlstringNoRemote URL for rule fetching
formatstringYesRule format: "yaml", "json", or "modsec"
update_intervalintegerNoAuto-update interval in seconds (remote sources only)
toml
[[rules.sources]]
name   = "custom"
path   = "rules/custom/"
format = "yaml"

[[rules.sources]]
name            = "owasp-crs"
url             = "https://example.com/rules/owasp.yaml"
format          = "yaml"
update_interval = 86400

CrowdSec Settings ([crowdsec]) ​

CrowdSec threat intelligence integration.

KeyTypeDefaultDescription
enabledbooleanfalseEnable CrowdSec integration
modestring"bouncer"Integration mode: "bouncer", "appsec", or "both"
lapi_urlstring"http://127.0.0.1:8080"CrowdSec LAPI URL
api_keystring""Bouncer API key
update_frequency_secsinteger10Decision cache refresh interval (seconds)
fallback_actionstring"allow"Action when LAPI is unreachable: "allow", "block", or "log"
appsec_endpointstring--AppSec HTTP inspection endpoint URL (optional)
appsec_keystring--AppSec API key (optional)

Host Configuration ([[hosts]]) ​

Static host entries (can also be managed via admin UI/API):

KeyTypeRequiredDescription
hoststringYesDomain name to match
portintegerYesListen port (usually 80 or 443)
remote_hoststringYesUpstream backend IP or hostname
remote_portintegerYesUpstream backend port
sslbooleanNoUse HTTPS to upstream (default: false)
guard_statusbooleanNoEnable WAF protection (default: true)

Cluster Settings ([cluster]) ​

Multi-node cluster configuration. See Cluster Mode for details.

KeyTypeDefaultDescription
enabledbooleanfalseEnable cluster mode
node_idstring"" (auto)Unique node identifier. Auto-generated if empty.
rolestring"auto"Node role: "auto", "main", or "worker"
listen_addrstring"0.0.0.0:16851"QUIC listen address for inter-node communication
seedsstring[][]Seed node addresses for cluster join

Cluster Crypto ([cluster.crypto]) ​

KeyTypeDefaultDescription
ca_certstring--Path to CA certificate (PEM)
ca_keystring--Path to CA private key (main node only)
node_certstring--Path to node certificate (PEM)
node_keystring--Path to node private key (PEM)
auto_generatebooleantrueAuto-generate certificates on first startup
ca_validity_daysinteger3650CA certificate validity (days)
node_validity_daysinteger365Node certificate validity (days)
renewal_before_daysinteger7Auto-renew this many days before expiry

Cluster Sync ([cluster.sync]) ​

KeyTypeDefaultDescription
rules_interval_secsinteger10Rule version check interval
config_interval_secsinteger30Config sync interval
events_batch_sizeinteger100Flush event batch at this count
events_flush_interval_secsinteger5Flush events even if batch not full
stats_interval_secsinteger10Statistics reporting interval
events_queue_sizeinteger10000Event queue size (drops oldest if full)

Cluster Election ([cluster.election]) ​

KeyTypeDefaultDescription
timeout_min_msinteger150Minimum election timeout (ms)
timeout_max_msinteger300Maximum election timeout (ms)
heartbeat_interval_msinteger50Main to worker heartbeat interval (ms)
phi_suspectfloat8.0Phi accrual suspect threshold
phi_deadfloat12.0Phi accrual dead threshold

Cluster Health ([cluster.health]) ​

KeyTypeDefaultDescription
check_interval_secsinteger5Health check frequency
max_missed_heartbeatsinteger3Mark peer unhealthy after N misses

Complete Default Configuration ​

For reference, see the default.toml file in the repository.

Next Steps ​

Released under the Apache-2.0 License.