10

I would like to use azure blob and CDN premium features but the documentation is very sparse. This is something totally doable on Amazon S3 / CloudFront.

For clarity I want *.azureedge.net/sample/index.html to equal*.azureedge.net/sample/ and *.azureedge.net/sample/test.html to equal to *.azureedge.net/sample/test

This is totally not clear and takes "up to 4 hours" to preview changes, so...

azure rules engine

After some investigation, Azure has a wrapper for Verizon Edgecast CDN, and this page looks identical to theirs...

1
  • 2
    Last night I set up some experiments to try and understand how Azure CDN's URL Rewriting feature works, and of 9 different settings, the only ones that worked as expected were the 2 controls (no rewriting). I also have been completely unable to find any helpful documentation.
    – nbering
    May 23, 2016 at 15:51

2 Answers 2

12

Edgecast support gave me the following rules:

enter image description here

  • add a new rule IF Always
    • Feature
      • URL Rewrite - source ((?:[^\?]*/)?)($|\?.*) destination $1index.html$2
      • URL Rewrite - source ((?:[^\?]*/)?[^\?/.]+)($|\?.*) destination $1.html$2

I created an npm package to deploy a folder and subfolders to azure storage see https://github.com/glued/yokai theres some additional information about configuring the CDN for clean urls here: https://github.com/glued/yokai/blob/master/azure.md

7
  • 1
    Thanks! Lack of escaping on the / characters suggests python-flavoured regex or something similar. Exploring this quickly with the regex tools on Regex101.com, I found that the pair of expressions above handle http://example.com/something/ and http://example.com/something ok, but if you actually want to point to a file, like say http://exameple.com/image.jpg it seems like it would behave strangely. If you don't mind, could you show some URLs and what they would be re-written to?
    – nbering
    May 26, 2016 at 1:02
  • made some modifications, link back up makes.azureedge.net/fish for an example of an image and index and makes.azureedge.net/fish/test = test.html which also works
    – glued
    May 27, 2016 at 17:07
  • i have few rules in web.config now i have to use CDN rule engine where i can learn create rewrite rules using rule engine for ex i need to redirect to external site when there is no file in url just domain name ? Jun 8, 2017 at 10:17
  • how to redirect both http and https the example.org and www.example.com to https:// www.example.org/home is there a tool to check the Regex before apply? "Approval of new Rules takes up to 4 hours." Sep 12, 2017 at 21:43
  • how to combine remove index.html with HTTP to HTTPS redirection? learn.microsoft.com/en-us/azure/storage/blobs/… Sep 19, 2017 at 2:52
3

I'm hesitant to post this as an answer. I ran out of time to actually try it out, but I found what appears to be a rules engine manual for verizon's CDN.

GlobalDots Knowledge Base - Edgecast Advanced HTTP Rules

There's a link near the top for a PDF guide.

HTTP Rules Guide PDF

It doesn't look like regular expressions. It's sort of in the spirit of pattern matching, but doesn't look as powerful or generic.

I haven't tried it out yet. It looks like a bit of work to decipher the documentation for use. There aren't many practical examples and the few it has leave me with more questions than answers. I'd love to hear how you make out with it.

4
  • 1
    Thanks, I'm currently in discussion with Edgecast support team to see if they can help and will post what they come back with.
    – glued
    May 23, 2016 at 16:52
  • I've got an answer that works but i'm tweaking it a bit and will report back soon.
    – glued
    May 25, 2016 at 1:12
  • @glued Did you had any luck with the Edgecast support? This quasi-regex thing is still driving mildly nuts. Thanks! Jan 15, 2018 at 19:20
  • @joannes-vermorel their support staff may be able to provide additional guidance if you reach out directly. Unfortunately I ended up migrating my project to firebase which included the rewrites i needed out of the box
    – glued
    Jan 15, 2018 at 23:57

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.