0

I'm trying to configure an Azure Frontdoor Standard resource (using terraform) for saas application with wildcard domain where the applications are hosted on an AKS cluster (that is routing to the correct application by looking at the request host header before routing to the correct pod). I am referencing this MS doc re: AFD wildcard config.

I've managed to configure the wildcard cert and multiple origins in a group on the afd resource.

However, it's not clear how to setup the origin groups host headers in terraform or ARM templates.

Normally, when configuring for one custom domain (i.e. not using wildcards), i would have a situation where:

  • a user types in address on their browser: www.address1.com.
  • for this, the application is hosted on aks cluster1-eastus.address1.com
  • domain www.address1.com request is routed on an origin that has Origin1 that has host name cluster1-eastus.address1.com and origin host header www.address1.com
  • the request is sent to cluster1-eastus.address1.com, with the host header www.address1.com. therefore the correct pod hosting the application is selected and it returns a response.

like this:

Single custom domain

However, when wildcards are used, how should this be setup so that if there are two applications on the aks (www1 and www2)

  • if a user types in www1.address1.com it gets correctly routed to www1 pod (i.e. the right host header that the user typed in is sent to the aks cluster).
  • similarly, if a user types in www2.address1.com it gets correctly routed to www2 pod.

Even better please would be if someone has a sample around in ARM, terraform, powershell or az-cli that documents how this can be achieved.

Wildcard setup

I cannot put *.address1.com in the origin

ossentoo
  • 1,675
  • 2
  • 20
  • 44

1 Answers1

0

I used a blank origin host header. My understanding is that when it's blank, the requested host name is used.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 17 '23 at 09:21
  • oh really? where is this documented by MS? Please send me a url. thanks – ossentoo Mar 24 '23 at 12:51