问题
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
- URL Rewrite - source
- Feature
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