An administrator needs to configure an Azure Application Gateway v2 to host two distinct web applications: sales.contoso.com and marketing.contoso.com. Traffic for sales.contoso.com must be directed to a backend pool named PoolSales, and traffic for marketing.contoso.com must be directed to a backend pool named PoolMarketing. Both applications use HTTPS on port 443. Which configuration should the administrator implement to route the traffic correctly?
- ACreate a single basic listener on port 443, and configure a path-based routing rule that maps the subdomain host headers to the backend pools.
- BCreate a single basic listener on port 443, and configure a user-defined route (UDR) with a next hop type of Virtual Network Gateway to route traffic based on host headers.
- Create two multi-site listeners (one for sales.contoso.com and one for marketing.contoso.com), and configure two basic routing rules to map each listener to its respective backend pool.Answer
- DCreate two multi-site listeners, and associate a Network Security Group (NSG) to the Application Gateway subnet with an inbound rule of priority 4096 that denies port 443 traffic.
Answer
Create two multi-site listeners (one for sales.contoso.com and one for marketing.contoso.com), and configure two basic routing rules to map each listener to its respective backend pool.
To host multiple websites or subdomains on a single Azure Application Gateway, you must configure a multi-site listener for each unique domain name. This enables the gateway to evaluate the HTTP Host header of incoming requests. Each multi-site listener is then associated with its own basic routing rule to direct traffic to the correct backend pool.
Step-by-Step Solution
Key Concept
Multi-site listeners and request routing rules in Azure Application Gateway