Azure CDN default document index.html

前端 未结 3 1613

I have now successfully setup my static website in a CDN, Is there a way to specify that index.html is the default document ? It is a 1 page site I just would like to brows

3条回答
  •  轮回少年
    2021-01-18 03:01

    Microsoft is working on this. At the moment you have only two possibilities to solve this:

    • Use CDN: With the premium version of Verizon you can create rules like Redirect Rules
    • Create an Web-App which act as a proxy and serves/redirects (to) blobs

    Using Premium CDN If you purchased the premium version of Verizon CDN then you can create custom Rewrite rules. You'll find this in the "Advanced Features" section of your CDN endpoint. Once you click on "Manage" you will be redirected outside the portal where you can manage your cdn.

    Hier you must create a redirect rule like this:

    Note that each change in a rule takes about 5 hours to be activated.

    To check if your redirect rule works you can install IIS and activate the URL Rewrite Module. In the Rewrite Module you can test your rules.

    1. Open IIS
    2. Open Url Rewrite Module
    3. Add Rule
    4. Add blank rule
    5. Test Pattern

    Please note that if you test your pattern, it must begin with the CDN source path which is a number and your endpointname like /829292/movies.

    Sometimes redirect rules causes problems with CDN Purging. You can solve this isssue by adding an if clause in your rule which says that redirect should only be active if it is not the purge agent.

提交回复
热议问题