如何Azure的斑点与自定义域子目录容器地图? [英] How to map Azure Blob with container with a custom domain sub-directory?

查看:150
本文介绍了如何Azure的斑点与自定义域子目录容器地图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站说mysite.com到mysite.azurewebsites.net这点(蔚蓝色的网站)。我也有图像容器mysite.blob.core.windows.net/images我要指出这mysite.com/images斑点。我使用GoDaddy。这有可能吗?

I have a website say mysite.com which point to mysite.azurewebsites.net (an azure website). I have also have blob with images container mysite.blob.core.windows.net/images I want to point this to mysite.com/images. I am using GoDaddy. Is this is possible?

推荐答案

这是不是DNS的配置,但URL重写配置。您将需要以下验证的URL重写的配置为您的Azure网站:

This is not DNS configuration, but URL rewrite configuration. You will need the following verified URL rewrite configuration for your Azure WebSite:

  <system.webServer>
   <rewrite>
     <rules>
      <rule name="images redirection" stopProcessing="false">
        <match url="images/(.*)" ignoreCase="true" />
        <action type="Redirect" url="https://double.blob.core.windows.net/images/{R:1}" redirectType="Permanent" appendQueryString="true" logRewrittenUrl="true" />
      </rule>
     </rules>
   </rewrite>
 </system.webServer>

您可以检查结果这里 - 首先检查原始页面的源代码 - IMG元素指的是本地图像: http://double.azurewebsites.net/images/some.jpg ,这是通过URL重写到Blob存储重定向(您可以重定向到任何你想要域)。

You can check the result here - check the original page source first - IMG element refers to a local image: http://double.azurewebsites.net/images/some.jpg, which is being redirected by the URL Rewrite to the blob storage (you can redirect to any domain you wish).

您可以阅读更多的URL重写模块这里和<一个href=\"http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module\"相对=nofollow>这里。

You can read more on URL Rewrite module here and here.

这篇关于如何Azure的斑点与自定义域子目录容器地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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