Hello @SkCloudAz ,
I understand that you would like to use a single wildcard listener and route different subdomains (which belongs to the same root domain) to different backend pools.
I discussed this with the Azure Application gateway product group team and below are their inputs:
Host name based routing with wildcard listener is not available.
So, the only possible ways to redirect your websites (based on the hostname) to different backend pools are as below:
1) One option, that you are already aware, is to use multiple listeners with respective domain names and map each to their specific rule & backend pool. For this, you may also want to set the rule priority in the right order as you’re using a wildcard.
2) Another option, which we believe would work for you (but it would be best that you test it out first) is to use URL rewrite to form paths and then use path-based routing to point to the respective backend pools.
- Capture the patterns and rewrite the URL to form a specific path.
Refer : https://learn.microsoft.com/en-us/azure/application-gateway/rewrite-http-headers-url#capturing - Use Re-evaluate path map, so the new path map is determined with the right backend.
Refer : https://learn.microsoft.com/en-us/azure/application-gateway/rewrite-http-headers-url#rewrite-configuration - Define Path-based routing to point each path to its own backend pool.
Kindly let us know if the above helps or you need further assistance on this issue.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.