← Back to Blog

How Fractional Canary Routing Works with Caddy & Nginx

Under the hood: dynamic proxy re-configuration, zero latency overhead, and percentage-based traffic splitting in modern container stacks.

By DevOps Architecture Team
1 min read
How Fractional Canary Routing Works with Caddy & Nginx

When rolling out new software versions in production, routing 100% of live traffic to a freshly deployed container is risky. SafeDeployer uses reverse proxy traffic management to split requests incrementally—allowing engineering teams to test new versions on 5%, 10%, or 25% of real user traffic first.

Modern Reverse Proxy Shifting

Whether you use Nginx, Caddy, or Traefik, SafeDeployer dynamically manages proxy upstream targets using low-overhead configuration reload APIs:

# Nginx split_clients traffic routing example
http {
    split_clients "${remote_addr}${http_user_agent}" $variant {
        10%     canary_v2;
        *       stable_v1;
    }

    server {
        listen 80;
        location / {
            proxy_pass http://$variant;
        }
    }
}

Proxy Traffic Shifting Architecture

Key Benefits of Proxy-Level Routing

  1. Sub-Millisecond Overhead: Traffic routing occurs directly at layer 7 reverse proxies without introducing external sidecars.
  2. Deterministic Session Persistence: Optional cookie or IP hash sticky sessions ensure individual users stay on the same canary version during their session.
  3. Automated Stage Progression: Automatically scale canary percentages from 10% to 50% to 100% as health criteria are satisfied.

Discussion