Skip to the content.

CLI Reference

conduit [OPTIONS] [COMMAND]

Table of Contents


Global options

-c and -h are accepted by every command. -V and --kubernetes-namespace belong to the server itself, so use them without a subcommand (conduit -V): a subcommand rejects them as an unexpected argument.

Flag Short Default Description
--config FILE -c auto-discovered (see below) Config file path
--version -V — Print version and exit
--help -h — Print help and exit
--kubernetes-namespace NS — — Read config from Kubernetes ConduitSite CRDs instead of a file. "*" watches all namespaces. Requires --features kubernetes. See Kubernetes CRD mode.

Config file discovery

When no -c flag is given, Conduit resolves the config in this order:

  1. conduit.json — if this file exists, use it
  2. conduit.yaml — fallback if conduit.json is absent
  3. conduit.yml — fallback if neither of the above exists

Auto-discovery only applies when no -c flag is given. When you pass -c some-other-name.json, that exact path is used with no fallback.

Both JSON and YAML are supported everywhere -c is accepted.


Server commands

start (default)

Start the reverse proxy server.

conduit                       # reads conduit.json (or .yaml / .yml)
conduit -c /etc/conduit.yaml  # explicit config path

On startup, Conduit:

  1. Loads and validates the config — on failure it exits 1 with a message that names the field for a validation error; a value of the wrong type is reported less precisely (see validate)
  2. Binds all configured ports
  3. Starts the Admin API on global.admin.bind (only if global.admin is configured)
  4. Begins serving traffic

Conduit does not watch the config file. To apply an edit without restarting, run conduit reload. (hotReload is a development feature: it watches the served static directories and reloads connected browsers when a file changes.)


validate

Parse and validate the config file, then exit. Does not start the server.

conduit validate
conduit validate -c staging.yaml

On success (exit 0):

Config is valid — 2 sites, 5 routes.

On failure (exit 1):

error at sites[0].proxy["/api"]: Invalid upstream URL 'not-a-url' — must start with http:// or https://
error at sites[0].rateLimit.windowSecs: windowSecs must be greater than 0

2 errors found.

Validation errors name the path of the invalid field (a single-site config is reported as sites[0]), so the problem is easy to locate even in a large file. Keys Conduit does not recognise are reported as warnings (… is not a recognized configuration key and will be ignored — check for a typo.) and do not change the exit code. This covers a key in a site (sites[0].jwtAuht), under global (global.workerz) and global.admin (global.admin.tokn), and at the top of a full configuration (globl); the value of such a key is ignored, so the default is in force.

A value of the wrong type (for example windowSecs: "soon") is reported less precisely. The command prints only error loading config: Cannot parse config file: <file>, without the field, because the cause underneath (the config is a few alternative shapes tried in turn) is not printed and does not name a field. This is a known gap.

Use in CI:

conduit validate -c conduit.yaml && echo "Config OK"

fmt

Normalize and pretty-print the config, preserving the input format: .yaml / .yml files stay YAML, .json files stay JSON.

# Print to stdout (useful for diffing)
conduit fmt
conduit fmt -c conduit.yaml   # → pretty YAML
conduit fmt -c conduit.json   # → pretty JSON

# Overwrite the file in place
conduit fmt --write
conduit fmt --write -c conduit.yaml

--write rewrites the config file in place. Useful for normalizing key order and whitespace after manual edits.

fmt writes the configuration as it was loaded, which is with every $VAR replaced by its value, so it refuses a file that refers to an environment variable that is set (the message names the variable, never the value): the secrets would be printed, or with --write stored in the file in place of the references. A reference to a variable that is not set is left as written.


init

Interactive wizard that generates a starter config in YAML or JSON. All questions can be skipped with flags — useful for scripts and CI pipelines.

# Interactive (default)
conduit init

# Non-interactive: accept all defaults
conduit init --yes
conduit init -y

# Non-interactive with overrides
conduit init -y --port 3000 --proxy http://localhost:4000
conduit init -y --format yaml --port 443 --tls-acme admin@example.com --host example.com -o prod.yaml

# Format inferred from -o extension
conduit init -o conduit.yaml   # YAML
conduit init -o conduit.json   # JSON

--yes defaults:

Setting Default
format yaml
port 8080
static ./dist (enabled)
proxy disabled
TLS disabled
health check enabled
log format dev

All flags:

Flag Short Description
--output FILE -o Output file path (format inferred from extension)
--yes -y Non-interactive: accept all defaults, no prompts
--format <yaml\|json> — Output format (overrides extension inference)
--port N — Port number [default: 8080]
--static-dir DIR — Serve static files from DIR
--no-static — Disable static file serving
--proxy URL — Proxy requests to upstream URL
--no-proxy — Disable proxy
--log <dev\|json\|combined\|none> — Log format [default: dev]
--no-health — Disable /__health__ endpoint
--tls-cert FILE — TLS certificate file (enables manual TLS)
--tls-key FILE — TLS private key file (required with --tls-cert)
--tls-acme EMAIL — ACME email (enables Let’s Encrypt auto-TLS)
--host HOST — Site host name (required with --tls-acme)

When both --yes and individual flags are given, the flags override the defaults. Any setting not covered by a flag is silently set to its default without prompting.


probe

Send a HEAD request to every upstream URL defined in the config and print a latency table. All upstreams are probed in parallel.

conduit probe
conduit probe -c production.yaml

Example output:

Probing 4 upstream(s) in parallel...

URL                         Status  Latency
────────────────────────────────────────────
✗ http://api-3:4000         timeout  10001 ms
✓ http://api-1:4000         200      12 ms
✓ http://api-2:4000         200      14 ms
✓ https://payment-svc:8443  200      31 ms

3/4 upstreams healthy

Results are sorted so failures appear first. Exits 1 if any upstream is unhealthy (status ≥ 500 or connection failure), 0 if all pass.

Notes:


Admin commands

These commands talk to the running server’s Admin API. See docs/admin.md for the full HTTP API reference, authentication details, and all endpoint request/response schemas.

The Admin API HTTP server only starts when global.admin is configured. Without it, admin CLI commands will fail to connect.

The admin address (where the CLI connects to) is resolved in this order:

  1. --admin ADDR flag
  2. CONDUIT_ADMIN environment variable
  3. Default: 127.0.0.1:2019

The default 127.0.0.1:2019 is only the CLI connection target. The server does not open this port unless global.admin.bind is set in config.

When global.admin.token is set on the server, authenticate CLI commands via the CONDUIT_ADMIN_TOKEN environment variable:

export CONDUIT_ADMIN_TOKEN="my-secret-token"
conduit status     # token sent automatically
conduit reload     # token sent automatically

The CLI talks to the Admin API over plain HTTP, so keep the address on loopback or behind a tunnel. A reply that is not 2xx (a wrong token gives 401, a cold-field rejection of a reload gives 400) makes the command print the server’s message and exit 1.

For direct curl calls, pass the token as a Bearer header:

curl -H "Authorization: Bearer $CONDUIT_ADMIN_TOKEN" http://localhost:2019/status

reload

Hot-reload the config file without restarting the server.

conduit reload
conduit reload --admin 127.0.0.1:2019

The server re-reads the config file from disk and applies all hot-reloadable changes immediately. If the new config changes a field that needs a restart, the whole reload is rejected and nothing is applied: the Admin API answers 400 with cold fields changed — restart required: <fields>, and conduit reload prints that and exits 1. Restart the server, or put those fields back. A config that does not parse or validate is rejected too, with HTTP 500 and failed to parse config: ... or config validation failed: ...; nothing is applied then either, and the CLI exits 1.

Hot-reloadable: proxy routes, static paths, auth config, rate limits, middleware, logging, cache, CORS, security headers, transforms, fault injection.

Not hot-reloadable (restart required): the set of listening ports, each port’s tls.cert / tls.key, global.workers, global.shutdownTimeoutSecs and global.admin.bind. (tls.versions and tls.ciphers are not restart fields: conduit validate rejects them, because the TLS backend cannot enforce them.)


status

Print server status as JSON. Add --upstream to show a table of upstream health.

conduit status
conduit status --admin 127.0.0.1:2019

# Show upstream health table
conduit status --upstream

Default output (JSON):

{
  "status": "running",
  "inflight": 42,
  "retry_inflight": 3,
  "sites": 2,
  "configured_upstreams": 4,
  "healthy_upstreams": 3,
  "total_probed_upstreams": 4,
  "config_path": "/etc/conduit/conduit.yaml"
}

This is the body of the Admin API’s GET /status (the fields are described in admin.md).

--upstream output (table):

URL                      Healthy  Latency     Ejected  5xx
──────────────────────────────────────────────────────────
✓ http://api-1:4000      ✓        12 ms       no       0
✗ http://api-2:4000      ✗        —           yes      5

1/2 upstreams healthy
Flag Description
--admin ADDR Admin API address
--upstream Show upstream health table instead of server JSON

shutdown

Gracefully stop the server.

conduit shutdown
conduit shutdown --admin 10.0.0.1:2019

Conduit waits for in-flight requests to finish, up to global.shutdownTimeoutSecs (default 30 s), then exits; it exits at once when nothing is in flight. (A SIGTERM goes through Pingora instead, which waits the whole period.)


upstreams

Manage upstream targets at runtime. Changes are in-memory only and are lost when conduit reload is run or the server restarts.

List upstreams

conduit upstreams
conduit upstreams --admin 127.0.0.1:2019

Prints all upstreams with health status, latency, and weight:

[
  {
    "route": "/api",
    "url": "http://api-1:4000",
    "healthy": true,
    "latency_ms": 12,
    "weight": 1,
    "ejected": false
  }
]

Add an upstream

conduit upstreams add --route /api --target http://api-3:4000
conduit upstreams add --route /api --target http://api-3:4000 --weight 2
conduit upstreams add --route /api --target http://api-3:4000 --site api.example.com:443
Flag Required Description
--route PATH ✅ Route path (e.g. /api)
--target URL ✅ Upstream URL to add
--weight N — Weight for weighted-round-robin, least-conn, p2c and least-bandwidth (default: 1)
--site LABEL — Limit to a specific site (e.g. api.example.com:443). Omit to apply to all sites with this route

Remove an upstream

conduit upstreams remove --route /api --target http://api-3:4000
conduit upstreams remove --route /api --target http://api-3:4000 --site api.example.com:443
Flag Required Description
--route PATH ✅ Route path
--target URL ✅ Upstream URL to remove
--site LABEL — Limit to a specific site

Change upstream weight

Effective when the route uses strategy: weighted-round-robin, least-conn, p2c or least-bandwidth (shares in proportion to the weights). The other strategies ignore weights.

conduit upstreams weight --route /api --target http://api-1:4000 --weight 3
conduit upstreams weight --route /api --target http://api-2:4000 --weight 1
Flag Required Description
--route PATH ✅ Route path
--target URL ✅ Upstream URL
--weight N ✅ New weight value
--site LABEL — Limit to a specific site

Tooling

features

Print the Cargo features a configuration needs, and nothing more, so you can build (or pick) a binary that fits the config instead of guessing between the default build, standard and full.

$ conduit -c conduit.yaml features
required: forward-auth, jwt
build:    cargo install lopatnov-conduit --no-default-features --features forward-auth,jwt
bundle:   `--features gateway` also covers this configuration
Option Meaning
--json Print {"required": [...], "build": "...", "bundle": ..., "missing": [...]} instead

completions

Generate shell completion scripts.

# Bash
conduit completions bash >> ~/.bashrc
source ~/.bashrc

# Zsh
conduit completions zsh >> ~/.zshrc

# Fish
conduit completions fish > ~/.config/fish/completions/conduit.fish

# PowerShell
conduit completions power-shell >> $PROFILE

# Elvish
conduit completions elvish >> ~/.config/elvish/rc.elv

Supported shells: bash, zsh, fish, power-shell, elvish.

Completions cover all subcommands, flags, and (where statically known) their accepted values.


man

Generate a man(1) page in roff format and write it to stdout.

conduit man > conduit.1
man ./conduit.1

# Install system-wide (Linux)
conduit man | gzip > /usr/share/man/man1/conduit.1.gz
mandb

Environment variables

Variable Default Description
RUST_LOG warn Log level for the server process. Format: error\|warn\|info\|debug\|trace or per-crate: conduit=debug,pingora=warn (the crates split out of conduit log under their own names: conduit_<name>, the crate name with lopatnov-conduit- replaced by conduit_ and dashes by underscores, e.g. conduit_runtime=debug, conduit_script_rhai=debug, conduit_plugin_wasm=debug)
CONDUIT_ADMIN 127.0.0.1:2019 Admin API address used by reload, status, shutdown, and upstreams commands
CONDUIT_ADMIN_TOKEN — Bearer token sent with every Admin API request from the CLI. Set when the server has global.admin.token configured.
CONDUIT_ACME_EXTRA_ROOT — Path to a PEM CA file trusted for ACME HTTP client. For CI environments using test ACME servers (e.g. Pebble) with self-signed certificates

Config files also support $VAR interpolation — any environment variable can be referenced in field values:

tls:
  cert: $TLS_CERT_PATH
  key: $TLS_KEY_PATH
apiKey:
  keys: ["$API_KEY_1", "$API_KEY_2"]

Unknown variables are left as-is (the literal $VAR_NAME string). Variables are expanded at startup; hot-reload re-expands them from the current environment.


Exit codes

Code Meaning
0 Success
1 Error — config parse failure, validation error, upstream probe failure, Admin API unreachable or answering with a status that is not 2xx (rejected reload, wrong token), or other fatal error
2 Invalid command line — an unknown flag or subcommand, a missing required argument (printed by the argument parser)

The server process itself only exits with 1 on startup errors. Once running, it exits cleanly (0) after a graceful shutdown triggered by conduit shutdown or SIGTERM.


Kubernetes CRD mode

Requires --features kubernetes at compile time.

# Watch ConduitSite CRDs in a specific namespace
conduit --kubernetes-namespace default

# Watch all namespaces (requires cluster-wide RBAC)
conduit --kubernetes-namespace "*"

Instead of reading a config file, Conduit connects to the Kubernetes cluster (via KUBECONFIG or in-cluster service account), reads all ConduitSite custom resources, and starts serving. Changes to CRDs are hot-applied automatically — no restart needed.

When --kubernetes-namespace is set, the -c flag is ignored.

See kubernetes.md for the CRD, the RBAC and the kubectl apply instructions.


Build features

Conduit uses compile-time feature flags to keep the binary lean and the attack surface small. cargo build --release with no flags produces the minimal build (default = ["proxy", "compression", "static", "hotreload", "mimalloc"]): core reverse proxy, TLS, static files, rate limiting, basic/API-key auth, compression, hot-reload, Prometheus metrics, health checks, and the Admin API. It’s the right choice for embedding Conduit in a larger system or for the smallest footprint.

The binaries and Docker images published as “standard” (the un-suffixed conduit-<target> downloads and the :latest image — see deployment.md) add the standard feature bundle on top of that: jwt + consumers + forward-auth + cache + acme, the auth/cache/ auto-TLS stack most self-hosted reverse-proxy / API-gateway deployments need. Reproduce it from source with --features standard.

--no-default-features goes the other way and compiles reverse proxying itself out — see Building without proxy for the exact effect, including which config shapes change meaning.

# Minimal build (default = ["proxy", "compression", "static", "hotreload", "mimalloc"]) — embed-friendly, smallest footprint
cargo build --release

# Standard build — matches the published "conduit-<target>" binaries
cargo build --release --features standard

# Single optional feature
cargo build --release --features jwt
cargo build --release --features rhai
cargo build --release --features acme

# Full build — every feature enabled
cargo build --release --features full

# Select combination
cargo build --release --features "jwt,rhai,redis"

Feature overview

What each feature does, which config it unlocks and what happens when a config uses a feature the binary lacks is in configuration.md: Optional build features, together with the bundle membership table and a guide to picking a build. This table lists the main extra crates each feature compiles in. conduit features -c FILE prints what a config needs.

Feature What it enables Dependencies added
proxy (default) Reverse proxying, load balancing, health checks, mirroring, sticky sessions reqwest, url, hmac, sha2
compression (default) Response compression (br, gzip, deflate, zstd) async-compression
static (default) Static files and fallback responses mime_guess
hotreload (default) Browser live reload (SSE + file watcher) notify
jwt JWT Bearer-token auth + JWKS URL jsonwebtoken
consumers Per-consumer credentials + rate limits —
forward-auth ForwardAuth subrequest middleware —
rhai Rhai scripting middleware (type: "script") rhai
wasm WASM plugin middleware (type: "wasm") wasmtime
ext-proc External processor over gRPC (type: "ext_proc") tonic, prost
tcp TCP passthrough proxy (type: "tcp" site) —
upload File upload handler (upload: site config) multer
redis Redis-backed rate limiting & caching redis
cache Response caching (proxy.*.cache); implies proxy —
disk-cache Disk-backed cache store (cache.store: "disk:/…") —
acme Auto-TLS / Let’s Encrypt (tls.acme) instant-acme, rcgen
fault-injection Fault injection for chaos testing —
otlp OpenTelemetry OTLP tracing opentelemetry stack
tokio-metrics conduit_eventloop_lag_ms Prometheus gauge —
kubernetes Kubernetes CRD config provider kube, k8s-openapi
mimalloc mimalloc allocator (secure mode) in the binary (on by default, in every bundle) mimalloc, libmimalloc-sys (C)
jemalloc jemalloc allocator instead of mimalloc (not in a bundle) tikv-jemallocator (C)
standard Bundle: jwt + consumers + forward-auth + cache + acme (typical self-hosted reverse-proxy / API-gateway set) — used by the published “standard” binaries/images bundle, no extra deps of its own
static-server Bundle for --no-default-features builds: static + compression + hotreload + mimalloc (the default set minus proxy) bundle, no extra deps of its own
gateway Bundle for --no-default-features builds: proxy + jwt + consumers + forward-auth + cache + acme + compression (the standard set without static files and hot-reload) bundle, no extra deps of its own
full Every optional feature above except jemalloc, which replaces the mimalloc it already has (static-server and gateway are shorthands, not extra capabilities) all of the above

When a feature is off but its config field is set, Conduit logs a warning at startup and continues with that feature disabled (fail-open, no crash).


jwt — JWT Bearer-token authentication

Enables jwtAuth site config. Supports HS256 (shared secret) and RS256/ES256 (remote JWKS URL). When disabled, jwtAuth config is ignored with a warning.

jwtAuth:
  jwksUrl: "https://auth.example.com/.well-known/jwks.json"
  issuer: "https://auth.example.com/"
  audience: ["my-api"]

Dependencies: jsonwebtoken = "9"


rhai — Rhai scripting middleware

Enables type: "script" middleware entries. Scripts run in a sandboxed Rhai engine with resource limits (500 000 operations, 1 MiB string, 65 536 array).

middleware:
  - type: script
    path: ./scripts/api-gate.rhai
    config: { api_key: "$SECRET" }
  - type: script
    phase: response
    path: ./scripts/response-enricher.rhai

Dependencies: rhai = "1" (sync feature)


upload — File upload handler

Enables upload: site config for multipart file uploads. Starts a loopback Axum server on a random port; the Pingora proxy forwards matching requests to it.

upload:
  path: /files
  dir: ./uploads
  maxFileSizeBytes: 10485760   # 10 MB
  allowedMimeTypes: ["image/jpeg", "image/png", "application/pdf"]

Files are saved with UUID v4 names. The success response includes name, originalName, size, and mimeType.

Dependencies: multer = "3"


cache — Response caching

Enables proxy.*.cache route config for in-memory response caching via Pingora’s cache layer. Supports TTL, skip-paths, cookie exclusion, Vary headers, stale-while-revalidate, and stale-if-error.

proxy:
  /api:
    targets: ["http://backend:4000"]
    cache:
      store: memory
      ttlSecs: 60
      staleWhileRevalidateSecs: 300

For Redis-backed shared cache add --features redis. For disk-backed persistent cache add --features disk-cache.


disk-cache — Disk-backed cache

Enables cache.store: "disk:/path" (the code that writes cache files; without it a route with a disk: store is not cached, and the start-up log says so). It is part of the standard, gateway and full bundles. Cache entries are written atomically (.tmp → rename) and survive restarts. Useful for large response bodies or when Redis is not available.

proxy:
  /assets:
    targets: ["http://assets:4000"]
    cache:
      store: "disk:/var/cache/conduit"
      ttlSecs: 86400   # 1 day

Requires --features cache (depends on cache).


acme — Auto-TLS / Let’s Encrypt

Enables tls.acme site config for automatic certificate provisioning via the ACME protocol (Let’s Encrypt). Certificates are fetched at startup and cached to disk. A background task checks every 12 hours and renews the certificate when no more than a third of its lifetime is left, and never later than 30 days before expiry (30 days for a 90-day certificate, 21 for a 64-day one, 15 for a 45-day one). If the CA supports ACME Renewal Information (ARI, RFC 9773, Let’s Encrypt does) the same check also asks it for the renewal window of the certificate and renews inside it, which can be earlier than the rule above (for example after a mass revocation) and never later; the renewal order then names the certificate it replaces (replaces), which Let’s Encrypt exempts from its rate limits. A CA without ARI, an unreachable CA or a failed ARI request changes nothing: the rule above decides. The CA’s Retry-After is honoured: it is not asked about a certificate again before that (by default 5 minutes to 24 hours), and that certificate is checked sooner than every 12 hours when the CA asks to be consulted earlier (the other certificates keep their own 12-hour cadence). The renewed files are written to the storage directory, but the running process keeps serving the certificate it loaded at startup — restart Conduit within that window (any restart or deploy does it) so the new certificate is picked up before the old one expires. Swapping the renewed certificate into the running listeners is not implemented yet.

Every time limit is configurable under tls.acme (seconds, 1 to 86400, 60 to 86400 for retryAfterMinSecs and 300 to 86400 for checkIntervalSecs, so that a CA that limits failed orders is not polled every few seconds; a typo cannot turn a limit into no limit), with the values below as the defaults: orderTimeoutSecs (60, one request of an order), validationTimeoutSecs (180, the whole challenge validation), ariTimeoutSecs (30, the whole renewal-information probe), retryAfterMinSecs (300) and retryAfterMaxSecs (86400, the bounds for the CA’s Retry-After; the minimum must not exceed the maximum) and checkIntervalSecs (43200, between two renewal checks; the renewal loop is shared by all ACME sites, so the shortest value counts). Like the rest of tls.acme they are read at start-up: a change needs a restart.

Each file is written atomically (staged, fsynced, renamed over the old one), so a crash never leaves a truncated key; the certificate and key are two files, so a crash between the two renames can leave a mismatched pair, which is detected on the next start (a cached certificate is reused only when its key matches it) and re-ordered. Every renewal creates new owner-only (0600) files, the public certificate included — a group or ACL set on the old files is not carried over. If renewal fails while the cached certificate is still valid, the site keeps serving it instead of falling back to plain HTTP.

During renewal the HTTP-01 token is answered by the listener that already owns the challenge port (httpRedirectPort, else port 80): the redirect service, or a plain-HTTP site on that port; only when nothing listens there does the task bind the port itself. A site on that port goes through its normal guard chain, so an ipFilter that does not admit the CA’s validation servers also blocks the challenge — prefer a dedicated httpRedirectPort. If the challenge port is held by a TLS site or a raw TCP proxy, renewal is disabled and an error is logged at startup.

The domain is taken from the site’s host field — no separate domain: field exists. The certificate and key are stored as <storage>/<host>.crt.pem and <storage>/<host>.key.pem, so conduit validate rejects a host that is not a plain DNS name (no /, \, .., empty label or other character that does not belong in a host name), and the flow checks the name again before it touches the disk.

host: api.example.com   # ← domain used for the certificate
port: 443
tls:
  acme:
    email: "admin@example.com"
    storage: "./certs"
    challenge: http-01
  httpRedirectPort: 80

Dependencies: instant-acme = "0.8", rcgen = "0.14"


redis — Redis-backed rate limiting and caching

Enables rateLimit.store: redis and cache.store: redis; the address is set once in global.redis.url (or the CONDUIT_REDIS_URL environment variable). Falls back to in-memory on connection failure (fail-open, logged as warning).

global:
  redis:
    url: "redis://localhost:6379"
sites:
  - port: 8080
    proxy: "http://127.0.0.1:4000"
    rateLimit:
      windowSecs: 60
      limit: 1000
      store: redis

Dependencies: redis = "1" (tokio-comp + rustls features)


tcp — TCP passthrough proxy

Enables tcp: site config for raw TCP forwarding (no HTTP parsing). Useful for databases, MQTT, custom binary protocols.

port: 5432
tcp:
  targets: ["db-primary:5432", "db-replica:5432"]
  strategy: round-robin
  connectTimeoutMs: 3000

consumers — Consumer model

Enables consumers: site config for named API clients with per-consumer credentials (API key, Basic Auth, JWT), rate limits, and custom upstream headers. The identified consumer’s username is injected as X-Consumer-ID.

consumers:
  consumers:
    - username: mobile-app
      apiKey: "$MOBILE_KEY"
      rateLimit: { windowSecs: 60, limit: 500 }
      headers: { X-Tier: mobile }
    - username: partner
      basicAuth: { password: "$PARTNER_PASS" }

JWT consumers (V2/V3) additionally require --features jwt.


forward-auth — ForwardAuth middleware

Enables forwardAuth: site config to delegate every authentication decision to an external HTTP service. 2xx = allow (inject response headers into upstream request); 4xx/5xx = deny; unreachable = fail closed.

forwardAuth:
  url: "http://auth-service:9000/verify"
  requestHeaders: [Authorization, Cookie]
  responseHeaders: [X-User-ID, X-Role]
  timeoutMs: 3000
  skipPaths: [/__health__]

ext-proc — External processor over gRPC

Enables type: "ext_proc" entries in middleware: the request headers, the request body, the response headers and a copy of the response body go to a gRPC service that speaks Envoy’s ext_proc protocol, which can change the headers, rewrite the request body, replace the response or answer the request itself. Fails closed (503) when the processor does not answer, unless failOpen: true. A build without this feature refuses to start with a fail-closed entry. Details: configuration.md.

middleware:
  - type: ext_proc
    config:
      grpc: "grpc://127.0.0.1:50051"
      timeoutMs: 200

fault-injection — Chaos testing

Enables faultInjection: site config. Do not use in production. Used to test circuit-breaker, retry, and timeout behaviour by injecting artificial delays and errors into a fraction of requests.

faultInjection:
  abort:
    percent: 5      # 5% of requests return 503
    status: 503
    body: '{"error":"injected"}'
  delay:
    percent: 10     # 10% of requests are delayed
    ms: 500

otlp — OpenTelemetry distributed tracing

Enables global.otlp configuration block. Conduit exports distributed traces to any OpenTelemetry-compatible backend (Grafana Tempo, Jaeger, Honeycomb, OpenTelemetry Collector) via gRPC OTLP.

global:
  otlp:
    endpoint: "http://tempo:4317"
    serviceName: "my-api"
    sampleRate: 0.1 # sample 10 % in production
    timeoutMs: 5000
sites:
  - port: 8080
    proxy: http://127.0.0.1:4000

Each span includes: method, path, status, duration_ms, upstream_url, request_id. 5xx responses set span status to ERROR.

When the binary is built without --features otlp, the global.otlp config block is silently ignored — no error, no traces.

Dependencies added: opentelemetry, opentelemetry_sdk, opentelemetry-otlp


wasm — WebAssembly plugin middleware

Enables type: "wasm" entries in the middleware array. Plugins are .wasm files that export on_request() -> i32 and a memory memory export.

middleware:
  - type: wasm
    path: ./plugins/my-plugin.wasm

Conduit uses Wasmtime as the WASM runtime. Plugins run in order alongside Rhai scripts (type: "script"). Plugin failures are fail-open — if a plugin panics or returns an error, Conduit logs a warning and continues processing.

Plugins may export two hooks:

Export Signature Phase Notes
on_request () → i32 Before upstream Required. 0 = continue, 1 = abort
on_response (status: i32) → i32 After upstream response Optional. 0 = continue, 1 = replace response

17 host functions are available across both phases: read/set/remove headers, get URI/method/IP/request-id, list header names, set response body/status, redirect, read plugin config, log.

See contrib/wasm/README.md for the full ABI reference and examples in Rust, C, and WAT.

When the binary is built without --features wasm, type: "wasm" entries log a startup warning and are skipped (fail-open).

Dependencies added: wasmtime (Cranelift JIT)


kubernetes — Kubernetes CRD config provider

Enables the --kubernetes-namespace startup flag. Conduit reads configuration from ConduitSite custom resources instead of a file, and watches for changes.

conduit --kubernetes-namespace default
conduit --kubernetes-namespace "*"    # all namespaces

Each ConduitSite spec mirrors the Conduit JSON schema — any field valid in conduit.yaml is valid in the CRD spec. Multiple resources in a namespace are combined into a multi-site config.

Install the CRD before use:

kubectl apply -f contrib/k8s/conduitsite-crd.yaml

When the binary is built without --features kubernetes, the --kubernetes-namespace flag does not exist in the binary.

Building it needs Rust 1.95 (kube 5.1). The k8s-openapi types are those of the Kubernetes 1.33 API, the oldest set k8s-openapi 0.29 offers; the provider reads only the ConduitSite resource (a CRD under apiextensions.k8s.io/v1). It has not been run against a live cluster of any version: the tests cover the event handling only.

Dependencies added: kube (runtime + derive), k8s-openapi, schemars, futures