Domain

Domains are the domain names used by the VCLGroup. There can be one or more domains assigned to a VCLGroup. Important to note is that when a Shared/Cloud deployment is used, only one of the same domain can be used on the same agent.

Multiple VCLGroups can use the same domain as long as it is on different agents. Domains have no real effect when deploying a VCLGroup as a root deployment (see root deployment chapter).

In order for traffic routing to work, a VCLGroup is required to have at least one domain when using routers.

Wildcard Domains

Since version 7.6.0, a domain can be a wildcard, e.g. *.example.com. Wildcard matching follows the same semantics as TLS certificates (RFC 6125):

  • *.example.com matches exactly one label: foo.example.com matches, but bar.foo.example.com does not. To match deeper subdomains, add another wildcard domain such as *.foo.example.com.
  • The apex domain is not covered by the wildcard: to also serve example.com, add it as its own domain.
  • An exact domain always wins over a wildcard. If one VCLGroup has *.example.com and another has bar.example.com, traffic for bar.example.com goes to the VCLGroup with the exact domain.

Wildcard matching applies both on the agents (request routing in the generated root VCL) and on the traffic routers (HTTP and DNS routing).

vcli domains add '*.example.com'

®Varnish Software, Wallingatan 12, 111 60 Stockholm, Organization nr. 556805-6203