Pra*_*tCa 5 asp.net-mvc url-rewriting
我正在使用 ASP.NET MVC + AngularJS 构建一个应用程序。现在,为了通过 AngularJS 进行 API 调用,我使用 URL 重写,因为 API 托管在不同的服务器上。
但它给了我 404.4 错误。我检查了请求的跟踪,并且模式匹配得很好。它正在尝试重写服务器 url,但随后出现 404.4 错误。
我还在我的 web.config 中添加了。我的重写规则如下:
<rewrite>
<allowedServerVariables>
<add name="HTTP_Authorization"/>
</allowedServerVariables>
<rules>
<rule name="Api Call" stopProcessing="true">
<match url="quote/(.*)" />
<action type="Rewrite" url="http://<server>/pc/service/edge/quote/{R:1}" appendQueryString="false" />
<serverVariables>
<set name="HTTP_Authorization" value="Basic <key>" />
</serverVariables>
<conditions logicalGrouping="MatchAny">
<add input="{REQUEST_URI}" pattern="quote/(.*)" />
</conditions>
</rule>
</rules>
</rewrite>
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
请帮忙。先感谢您。

| 归档时间: |
|
| 查看次数: |
1533 次 |
| 最近记录: |