You manage an Azure Application Gateway that uses the Standard_v2 SKU. You are adding a multi-site HTTP listener in the Azure portal.
Requirements:
- One listener must accept requests for contoso.com itself and for any subdomain of contoso.com, such as www.contoso.com and shop.contoso.com.
- The configuration must be accepted by Application Gateway when you save the listener.
Which host name configuration should you enter for the listener?
Why
A multi-site listener on the v2 SKU can contain an array of up to five host names, and these names can include the * and ? wildcards. The wildcard *.contoso.com needs a dot before contoso, so it matches subdomains but not contoso.com. You must therefore list contoso.com as well. Regular expressions and the ** pattern are not valid host names.
- Correct: Host type Multiple/Wildcard; host names
contoso.comand*.contoso.com. A listener can hold an array of up to five host names.contoso.comcovers the parent domain, and*.contoso.comcovers its subdomains, so the one listener meets both parts of the requirement. - Not correct: Host type Multiple/Wildcard; host names
**.contoso.comandcontoso.com. Two asterisks together in one component of a host name (**) are listed as invalid, so this pattern is not accepted. - Not correct: Host type Multiple/Wildcard; host names
^(.+\.)?contoso\.com$. Host names cannot be given as regular expressions. Only the * and ? wildcard characters can be used to build a host name pattern. - Not correct: Host type Multiple/Wildcard; host names
*.contoso.comandwww.contoso.com.*.contoso.comrequires a dot before contoso, so it does not match contoso.com. Adding www.contoso.com still leaves the parent domain unmatched. - Not correct: Host type Single; host name
contoso.com. A single, non-wildcard host name matches only that one name. Subdomains such as shop.contoso.com would not be accepted.
Source
- Hosting multiple sites on Azure Application GatewayMicrosoft Learn