Azure CDN - Multiple sites on the same domain

Edgar Dockus 6 Reputation points
2022-10-10T11:34:26.13+00:00

I have two origins in two origin groups.

origin1 in group1
origin2 in group2

Both origins are storage static websites. The origins point to two different storage accounts hosting two different static websites, origin1 is the default origin. I then have 3 rules within the Rules engine:

Rule does a URL redirect HTTP to HTTPS

249011-image.png

And two more rules that do an origin group override depending on the URL path access:

248983-image.png

going to https://xxx.azureedge.net loads the site on origin1, going to https://xxx.azureedge.net/origin1 loads the site on origin1, all good.

Going to https://xxx.azureedge.net/origin2 tries to load the site on origin2 and it fails. It fails because the site itself tries to look for css and js files in a folder called static, in other words the site tries to load https://xxx.azureedge.net/static/somefile.css instead of https://xxx.azureedge.net/origin2/somefile.css. Origin1 site loads fine because it's the default origin, but Origin2 is not the default hence the files are not there. Is there any way around this?

Azure Content Delivery Network
{count} votes

1 answer

Sort by: Most helpful
  1. Edgar Dockus 6 Reputation points
    2023-01-30T13:58:27.7433333+00:00

    Hi,

    We've made a source code change on the React app to change how it references js/css files. Instead of going for /static/css/file.css it is now looking for /origin1/static/css/file.css.

    1 person found this answer helpful.
    0 comments No comments

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.