Virtual Hostnames for Load Balancers

Use virtual hostnames with a load balancer for one or more listeners.

When used in concert with records you create in your DNS system, you can assign virtual hostnames to any listener you create for your load balancer. Hostnames associated with a listener correspond to the backend sets of that listener. These backend sets route traffic to specific backends which host different applications. Some advantages of virtual hostnames include:

  • A single associated IP address. Multiple hostnames, backed by DNS entries that you create in your nameservers, can point to the same load balancer IP address.

  • A single load balancer. You do not need a separate load balancer for each application.

  • A single load balancer shape. Running multiple applications behind a single load balancer helps you manage aggregate bandwidth demands and optimize utilization.

  • Simpler backend set management. Managing a set of backend servers under a single resource simplifies network configuration and administration.

You can perform the following virtual hostname management tasks:

You can define exact virtual hostnames, such as "app.example.com," or you can use wildcard names. Wildcard names include an asterisk (*) in place of the first or last part of the name. When searching for a virtual hostname, the service chooses the first matching variant in the following priority order:

  1. Exact name match (no asterisk), such as app.example.com.

  2. Longest wildcard name that begins with an asterisk, such as *.example.com.

    Note

    Prefix wildcard names might require a wildcard certificate for HTTPS sites.

  3. Longest wildcard name that ends with an asterisk, such as app.example.*.

    Note

    Suffix wildcard names might require a multi-domain Subject Alternative Name (SAN) certificate for HTTPS sites.

You do not need to specify the matching pattern to apply. The pattern is inherent in the asterisk position, that is, starting, ending, or none.

The following considerations apply to virtual hostnames:

  • You cannot use regular expressions.

  • To apply virtual hostnames to a listener, you first create one or more virtual hostnames associated with a load balancer.

  • Virtual hostname selection priority is not related to the listener's configuration order.

  • You can apply a maximum of 16 virtual hostnames to a listener.

  • You can associate a maximum of 16 virtual hostnames with a load balancer.

Note

The virtual hostnames feature supports HTTP and HTTPS listeners only, but does not support TCP listeners.

Note

Default Listener

If a listener has no virtual hostname specified, that listener is the default for the assigned port.

If all listeners on a port have virtual hostnames, the first virtual hostname configured for that port serves as the default listener.