【发布时间】:2014-12-15 07:46:58
【问题描述】:
我有一个 Ember 应用程序,它使用 CORS 访问不同子域上的 API。 由于 IE8 和 IE9 没有完整的 CORS 支持,我需要创建一个代理来访问 API。
Ember 应用程序部署在 Azure 网站上,API 是 Web 角色。我尝试使用 URL 重写创建代理,但只得到 404 Not Found。
我想要以下行为
https://www.cloudstorez.com/rewrite/cms/public/designs
重写为
https://cms-public.cloudstorez.com/designs
URL 重写如下所示
<rule name="Rewrite to APIs" stopProcessing="true">
<match url="^rewrite/([^/]*)/([^/]*)/(.*)" />
<action type="Rewrite" url="https://{R:1}-{R:2}.cloudstorez.com/{R:3}" />
</rule>
如果我改为进行相应的重定向,它就可以正常工作。
<rule name="Redirect to APIs" stopProcessing="true">
<match url="^redirect/([^/]*)/([^/]*)/(.*)" />
<action type="Redirect" url="https://{R:1}-{R:2}.cloudstorez.com/{R:3}" />
</rule>
我的重写是否有问题,或者 Azure 网站是否有关于 URL 重写或访问其他服务器的限制?
【问题讨论】:
标签: iis azure ember.js url-rewriting