0
votes

I have an Azure CDN profile resource with Premium Verizon tier which allows customization for Rule Engine

Created an endpoint which serves from a URL https://test-cdn1.azureedge.net the content from a storage account which is mapped as the origin to blob container in storage account with origin path pointing to blob container name /blob-container

I am trying to add Rewrite rules (in HTTP Large Object Rules Engine Section) for specific two pages

  • https://test-cdn1.azureedge.net/main.js URL should rewrite to https://test-cdn1.azureedge.net/js/main.d20ff936.chunk.js

    This file is at /blob-container/js/main.d20ff936.chunk.js

  • https://test-cdn1.azureedge.net/main.css URL should rewrite to https://test-cdn1.azureedge.net/css/main.cb03e.chunk.css

    This file is at /blob-container/css/main.cb03e.chunk.css

  • https://test-cdn1.azureedge.net/vendor.js URL should rewrite to https://test-cdn1.azureedge.net/js/js/1.77a25e9f.chunk.js

    This file is at /blob-container/js/js/1.77a25e9f.chunk.js

Here is a screenshot of what I have added at hte momement and is not working. enter image description here

Also for any other URL request, I wish to give back a plain old empty 404 - Not Found.

Need help, thanks

1

1 Answers

0
votes

I know the problem now, solved it by a few tries, it does take some time to get effective though.

The source and destination entries are the mapped folder path to the resource, so in above the three entry would be

Source: blob-container/main.js, Destination: blob-container/js/main.d20ff936.chunk.js

Source: blob-container/main.css, Destination: blob-container/css/main.cb03e.chunk.css

Source: blob-container/vendor.js, Destination: blob-container/js/1.77a25e9f.chunk.js

Still look for a way to return 404 Not Found for all other CDN path URL fetches