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
| Example | Use Case | Key Features |
|---|---|---|
| Simple Proxy | Basic reverse proxy | Single upstream, health checks |
| API Gateway | API management | Versioning, auth, rate limiting |
| API Validation | Schema validation | OpenAPI specs, JSON Schema, contract enforcement |
| Load Balancer | Traffic distribution | Multiple backends, algorithms |
| Traffic Mirroring | Canary deployments | Shadow traffic, safe testing, sampling |
| Static Site | File serving | Caching, compression, SPA |
| Multi-tenant TLS | SaaS with per-customer domains | Per-SNI ACME, independent schedulers |
| Microservices | Service mesh | Multi-service routing |
| Security | WAF + Auth | Agents, protection layers |
| Observability | Monitoring stack | Prometheus, Grafana, tracing |
| WebSocket | Real-time apps | WS proxying, inspection |
| Image Optimization | WebP/AVIF conversion | Accept negotiation, caching |
| AI Gateway | LLM API proxy | Prompt security, PII filtering |
Getting Started
Each example follows this structure:
- Overview - What the example demonstrates
- Configuration - Complete
zentinel.kdlfile - Setup - How to run the example
- Testing - Commands to verify it works
- 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