Multi-origin without modifying DNS

Deploy a new version without any downtime. Migrate services gradually. Test in production with a real subset of users. All of this can be done from the CDN, without modifying the DNS, without waiting for TTL propagation, and without the stress of coordinating emergency plans between teams.

Transparent Edge’s multi-origin configuration allows you to assign different backends based on any element of the HTTP request: the URL, a cookie, a header. The VCL enables highly precise routing rule tuning, deploys in seconds, and can be rolled back just as quickly.

What is multi-origin and how does it work

In a standard configuration, a domain points to a single backend. In multi-origin, the CDN decides which backend to send each request to before it reaches the origin. This decision can depend on any visible element in the request: the route, a content negotiation header, a session cookie, the user’s country, the client version, and more.

The mechanism is straightforward: in ‘vcl_recv‘, ‘req.backend_hint‘ is set with the target backend. The necessary backends are declared in the dashboard and referenced from the VCL.

sub vcl_recv {
  # Default backend
  set req.backend_hint = c83_monolito.backend();

  # The blog points to a different server.
  if (req.url ~ "^/blog") {
    set req.backend_hint = c83_blog.backend();
  }
}

The request reaches the CDN, the VCL evaluates it and forwards it to the correct backend. DNS is not involved in this process. The change is applied in seconds.

Migrate the monolith route by route via URL

The most common scenario in architectures undergoing transition is as follows: there’s a monolith managing everything, and a team is gradually extracting services. The new microservice is ready, but production validation requires real traffic. With a DNS change, that’s risky; with multi-origin architecture, it’s safe.

The new service is configured as a backend in Transparent Edge and routed to it using a URL prefix:

sub vcl_recv {
  set req.backend_hint = c83_monolito.backend();

  # The order API routes go to the new microservice
  if (req.url ~ "^/api/orders") {
    set req.backend_hint = c83_orders_service.backend();
  }
}

The user doesn’t notice anything. The DNS doesn’t change. If something goes wrong, reverting the VCL takes minutes. The monolith continues to handle the rest of the process while the team works in parallel.

The pattern supports a phased migration: first ‘/api/orders‘, then ‘/api/products‘, then ‘/api/users‘. Each migrated route is validated independently before moving on to the next.

Cookie-controlled deployments

The blue/green deployment maintains two identical environments running simultaneously, one active and one on standby. Switching traffic between them, with multi-source traffic, is a VCL change. No DNS, no maintenance window.

Canary deployment takes this a step further, sending only a fraction of the traffic to the new environment before fully opening it. Cookies allow for precise control. Users with a specific cookie are directed to the new backend; the rest remain in the current one.

sub vcl_recv {
  set req.backend_hint = c83_blue.backend();

  # Users with the canary cookie go to the green environment
  if (req.http.Cookie ~ "deployment=green") {
    set req.backend_hint = c83_green.backend();
  }
}

In practice, the QA team or beta testers receive this cookie. Production traffic is unaffected. Once validation is successful, the VCL is changed so that everyone goes to the green environment. The switchover is instantaneous.

The same mechanism applies to phased deployments based on user segments: enterprise customers, users of a specific plan, sessions initiated on a particular date. If the information is stored in a cookie, the CDN can make the decision.

The header as a routing signal

Headers provide more explicit control, especially useful when the client is an internal service, a CI/CD pipeline, or a QA tool that can construct the request with custom headers.

sub vcl_recv {
  set req.backend_hint = c83_produccion.backend();

  # Internal requests with the staging header go to the test environment
  if (req.http.X-Target-Env == "staging") {
    set req.backend_hint = c83_staging.backend();
  }
}

With this pattern, a CI pipeline can run integration tests against the actual production domain (same URL, same TLS certificate, same CDN) but routed to a test environment backend. The end user never sees these requests. The team tests against the real infrastructure, not against a parallel environment that always has some discrepancy.

This scheme is also useful in multi-region architectures: the header indicates the client’s origin region, and the VCL selects the corresponding backend without the need for separate subdomains or additional DNS records.

What changes in practice

Multi-origin turns the CDN into a routing layer that operates before requests reach any application server.

The consequences are concrete:

  • Blue/green deployments no longer rely on DNS propagation.
  • Monolith to microservices migrations are performed route by route, with real traffic and rollback in seconds.
  • Test environments can use the production domain without additional infrastructure.

The configuration model is declarative. You write a VCL, apply it, and Transparent Edge distributes it to the edge nodes. If something goes wrong, the rollback uses the same operation. The entire process, from change to validation, fits within the time of a team meeting.

To generate VCL snippets adapted to your configuration, go to Easy Setup in your control panel and it will guide you step by step. If you have questions about routing or need help with a specific case, the Transparent Edge support team is available to help you.

Reference documentation: