Azure CDN 默认文档 index.html [英] Azure CDN default document index.html

查看:23
本文介绍了Azure CDN 默认文档 index.html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在已经在 CDN 中成功设置了我的静态网站,有没有办法指定 index.html 是默认文档?这是一个 1 页的站点,我只想浏览到根 url,而不必键入/index.html ..

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 browse to the root url without having to type /index.html ..

谢谢

推荐答案

Microsoft 正在致力于此.目前你只有两种可能来解决这个问题:

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

  • 使用 CDN:使用高级版 Verizon,您可以创建重定向规则等规则
  • 创建一个 Web 应用程序,充当代理并提供/重定向(到)blob

使用高级 CDN如果您购买了 Verizon CDN 的高级版本,那么您可以创建自定义重写规则.您可以在 CDN 端点的高级功能"部分找到它.单击管理"后,您将被重定向到可以管理 CDN 的门户之外.

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:

请注意,规则中的每次更改大约需要 5 小时才能激活.

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

要检查您的重定向规则是否有效,您可以安装 IIS 并激活 URL 重写模块.在重写模块中,您可以测试您的规则.

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. 打开 IIS
  2. 打开 URL 重写模块
  3. 添加规则
  4. 添加空白规则
  5. 测试模式

请注意,如果您测试您的模式,它必须以 CDN 源路径开头,该路径是一个数字和您的端点名称,如/829292/movies.

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.

有时重定向规则会导致 CDN 清除出现问题.您可以通过在规则中添加一个 if 子句来解决此问题,该子句表示重定向仅在它不是清除代理时才应处于活动状态.

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.

这篇关于Azure CDN 默认文档 index.html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆