Azure CDN Rewrite URL to index.html not working

Viewed 67

I have a static website with one $web container and one more container named storybook containing a build in the $web container. Currently to reach the storybook container I have to write: www.xyz/storybook/index.hmtl. The goal is to reach the Image when calling www.xyz/storybook. To achieve this I tried to setup Rule Engines URL Rewrite. My rule looks like this Somehow the rewrite is not working and I have no idea why.

1 Answers

I tried to reproduce the same in my environment i am getting the same error as 404:

Thus, to resolve this issue, check whether you have provided correct Html error document path as below:

enter image description here

In $web container, I have added my error document path as abc.html file and my image files as well. In document path, try to add your image URL path as below:

enter image description here

Also, when I try to browse my primary endpoint URL, I am getting the image successfully as shown below. For this, make sure your container’s access level should be public container (anonymous read access for container and blobs) and I created azure CDN under security + networking.

enter image description here

Check whether you have given correct origin path default as below:

enter image description here

To access the image, copy the Endpoint hostname along with your image url path as below that is, Append with blob url (/$web/abc.html) by omitting origin hostname(https://imran955.blob.core.windows.net)

i.e., https://Endpointhostname/blob url

enter image description here enter image description here

Result:

enter image description here

Related