Skip to content

Domain Router

Dick van der Heiden edited this page Nov 5, 2022 · 1 revision

A request takes an internal route:

  • The request traverses the internet to reach the network.
  • The request arrives at the load balancers.
  • The load balancers proxy the request to the cluster. Possibly to one specific node.
  • The request is handled by server software (such as nginx) on the cluster node.

The 'balancer backend name' attribute determined whether the request should be routed to either:

  • Any node in the cluster.
  • One specific node.

This attribute belonged to the virtual host and URL redirect models.

This logic fails in the following scenario. I will use example.com as an example domain.

  • A virtual host exists for example.com.
  • Requests for example.com should not be handled by the virtual host.
  • Requests should be handled by an intermediate software layer. For example: Varnish.

In this case, the request should not be routed to the virtual host, but to Varnish. As the 'balancer backend name' belonged to the virtual host and URL redirect models, this was not possible with the previous logic.

If we ever implement Varnish, a 'Varnish VCL' model and a varnish_vcl_id attribute (in addition to virtual_host_id and url_redirect_id) or similar would be added to the domain router model.

The technical implementation of domain routers is as follows:

  • Domain routers are created when virtual hosts or URL redirects are created.
  • Domain routers are created for the domain and for each server alias.
  • When server aliases are removed from virtual hosts or URL redirects, their domain routers are deleted.
  • When virtual hosts or URL redirects are deleted, their domain routers are deleted.
  • To route incoming requests to a specific node, set the node ID attribute.
  • 1 domain router exists for each domain.
  • Either virtual host ID or URL redirect ID is set.
Clone this wiki locally