Examples

Complete, production-ready configuration examples for common Zentinel use cases. Each example includes the full configuration file, setup instructions, and testing commands.

Quick Reference

ExampleUse CaseKey Features
Simple ProxyBasic reverse proxySingle upstream, health checks
API GatewayAPI managementVersioning, auth, rate limiting
API ValidationSchema validationOpenAPI specs, JSON Schema, contract enforcement
Load BalancerTraffic distributionMultiple backends, algorithms
Traffic MirroringCanary deploymentsShadow traffic, safe testing, sampling
Static SiteFile servingCaching, compression, SPA
MicroservicesService meshMulti-service routing
SecurityWAF + AuthAgents, protection layers
ObservabilityMonitoring stackPrometheus, Grafana, tracing
WebSocketReal-time appsWS proxying, inspection
Image OptimizationWebP/AVIF conversionAccept negotiation, caching
AI GatewayLLM API proxyPrompt security, PII filtering

Getting Started

Each example follows this structure:

  1. Overview - What the example demonstrates
  2. Configuration - Complete zentinel.kdl file
  3. Setup - How to run the example
  4. Testing - Commands to verify it works
  5. Customization - Common modifications

Running Examples

All examples assume Zentinel is installed:

# Install Zentinel
cargo install zentinel-proxy

# Run with a configuration
zentinel -c zentinel.kdl

For examples using agents, install the required agents first:

# Example: Install WAF and auth agents
cargo install zentinel-agent-waf zentinel-agent-auth

Example Files

All configuration files in these examples are available in the examples directory of the main repository:

git clone https://github.com/zentinelproxy/zentinel
cd zentinel/examples