Multisite and wildcard domaine

SkCloudAz 21 Reputation points
2022-10-27T15:41:01.703+00:00

Hi,

I want to setup an Application Gateway Layer 7 + WAF v2 in front of my 200+ websites to protect from all the common web-hacking attacks.

I configured one HTTPS listener for all my websites (use wildcard. ex : *.contoso.com).
They are all under the same domain.
ex:

  • xyz1.contoso.com
  • xyz2.contoso.com
  • xyz3.contoso.com
  • etc.

But, I would like to redirect some websites (base on the hostname), to different backend pools.
I don't seem to be able to that with only one listener ?

The only way I found, would be to create as many listeners that I have of websites, to redirect them to the correct backend pools.
Is there another way to do that ?

Summary :

  • One HTTPS listener for a multisite wildcard domain (ex.: *.contoso.com)
  • Redirect xyz1.contoso.com to backend pool A
  • Redirect xyz2.contoso.com to backend pool B
  • Redirect xyz3.contoso.com to backend pool C
  • etc.
  • for all my websties (I have a lot...)

I wish I could create a rule, associate it to my HTTPS Listener (multi-site wildcard domain) and then specify (based on the hostname received) which backend pool to choose.
But it seems that we can do that only for "path-based rules", NOT for "host-based rules".

Maybe I miss something, can someone help me.

I just want to be sure to use the best approach.

Thanks,

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,217 questions
{count} votes

Accepted answer
  1. GitaraniSharma-MSFT 50,096 Reputation points Microsoft Employee Moderator
    2022-10-31T13:48:42.033+00:00

    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.

    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.