Reverse proxy & balancing
Route to upstream apps with health-aware load balancing.
Route to an upstream pool
A proxy domain forwards traffic to one or more upstreams. This example enables WebSocket forwarding and periodic health checks.
Configuration exampleyaml
domains:
- host: api.example.com
type: proxy
ssl:
mode: auto
proxy:
algorithm: least_conn
websocket: true
upstreams:
- address: "http://127.0.0.1:3000"
- address: "http://127.0.0.1:3001"
health_check:
path: /health
interval: 10s
Choose a balancing strategy
UWAS supports round-robin, least connections, IP hash, URI hash, random and sticky routing. The documented YAML spelling for least connections is least_conn. Weights, circuit breakers and canary routing let you tune distribution and failures.
Proxy a managed app
Applications managed by UWAS can be addressed through apps:// names. Keep the application definition in apps.d and the public host route in the domain configuration.
Configuration exampleyaml
# /etc/uwas/apps.d/my-api.yaml
name: my-api
runtime: node
work_dir: /var/lib/uwas/apps/my-api
port: 0
env:
NODE_ENV: production
# Route in uwas.yaml
domains:
- host: api.example.com
type: proxy
ssl:
mode: auto
proxy:
upstreams:
- address: "apps://my-api"
Need every option? Read the complete configuration reference and the upstream upgrade notes for your release.