Azure CDN rules engine to rewrite default document and remove .html extension

喜夏-厌秋 提交于 2019-12-17 23:15:01

问题


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...

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


回答1:


Edgecast support gave me the following rules:

  • 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




回答2:


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.



来源:https://stackoverflow.com/questions/37368829/azure-cdn-rules-engine-to-rewrite-default-document-and-remove-html-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!