Examples
Policy Rate Limit
Rate limits requests in two stages with the Praxis Policy Engine's in-process limiter (ratelimit/limitador, experimental)
Category: Setup-dependent integration
Task: Rate limits requests in two stages with the Praxis Policy Engine’s in-process limiter (ratelimit/limitador, experimental)
Prerequisites: The external service, credentials, or certificates referenced by this configuration.
Run it: Use ghcr.io/praxis-proxy/praxis:0.8.0 and follow the first reverse-proxy tutorial to mount and start the configuration.
This configuration comes from the selected release. The example has not been run here; external services are not bundled.
Download the source file.
Companion resources from the same snapshot:
# Policy rate limiting
#
# Rate limits requests in two stages with the Praxis Policy Engine's
# in-process limiter (`ratelimit/limitador`, experimental). Before identity, a
# per-client-address limit and a coarse limit shared by every caller protect
# credential verification; after identity, a per-subject limit applies to the
# API-key caller. A denial is HTTP 429 with `Retry-After` and never reaches the
# backend.
#
# The policy document at /etc/praxis/rate-limit-policy.yaml and the API-key
# file it references must be provisioned before startup; see
# tests/integration/fixtures/rate-limit-policy.yaml and api-keys.yaml for a
# reference pair.
#
listeners:
- name: default
address: "127.0.0.1:8080"
filter_chains:
- main
filter_chains:
- name: main
filters:
# `config_path` points at the policy document, which declares the
# API-key resolver, the two limiter plugins and the `rate_limits:` list
# that selects them. Counters live in each limiter instance: they are
# per replica and reset when the configuration reloads.
- filter: policy
config_path: /etc/praxis/rate-limit-policy.yaml
- filter: router
routes:
- path_prefix: "/"
cluster: backend
- filter: load_balancer
clusters:
- name: backend
endpoints:
- "127.0.0.1:3000"
insecure_options:
allow_private_endpoints: true # example proxies to local backends