Configure multiple backends with Azure Front Door using paths

100 views Asked by At

Currently I have xyz.azurefd.net and am having a bit of trouble configuring it correctly. I have two backends: frontend1 and frontend2

I want to configure an endpoints so that xyz.azurefd.net/frontend1 points to frontend1 and xyz.azurefd.net/frontend2 points to frontend2.

Some other considerations, when I normally hit frontend1 it appends a path /abc so it looks like frontend1.com/abc/*

How can I configure my azure front door to do the above behavior?

PS.

I set up my route with patterns to match: /frontend1/* My endpoint is xyz.azurefd.net My backend points to an azure web app However when I go to https://xyz.azurefd.net/frontend1/

I get a 404 error.

If I set my patterns to match: /* And go to https://xyz.azurefd.net/ It sends me to https://xyz.azurefd.net/PATH/PATH1/PATH2 as a default path.

I think the reason I am getting a 404 possibly could be due to the react application that is being served. It may be that when I use the path /frontend1/* to redirect to my application, my application might be reading the /frontend1/ as a path causing it to 404. How can I make this setup work where the path /frontend1/ will be my base path so when I go to it I can visit https://xyz.azurefd.net/frontend1/PATH/PATH1/PATH2/

1

There are 1 answers

0
Suresh Chikkam On

Configure multiple backends with Azure Front Door using paths

You can define routing rules that specify which backend to use based on the request's URL path. For example, you can route requests to /api to one backend and requests to /images to another backend.

  • Front Door allows you to define frontend hosts, which are the public-facing endpoints through which clients access your application.

Front door and CDN<myfirstfd<settings<front door manager<your-routes.

enter image description here

Here you can find the below configuration options add your path below.

enter image description here

Once the setup is done, just refresh your FD and route. Then I can be able to route /frontend1.

enter image description here

These my frontend applications (1,2) & Origin type is app service.

enter image description here

Frontendapp01: enter image description here

Frontendapp02: enter image description here