由于azure错误,无法访问特定的rest api



我的应用程序使用spring-rest并部署在Azure服务器中。使用spring-rest.创建了rest api

我能够访问所有的rest url,除了在一个场景中。

例如:http://mydomain123.com/api/abchttp://mydomain123.com/api/xyz/abc

我能够访问以上网址

http://mydomain123.com/api/binhttp://mydomain123.com/api/xyz/binhttp://mydomain123.com/api/bin/dfdff

但是上面的URL有bin字,我得到下面的错误:

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

我正在尝试如下,但根本不工作:

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />

</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

请有人帮我解决以上问题(我应该能够访问rest api,即使其中有单词"bin"(

请确保将web.config文件放在应用程序文件夹的根目录下。进行更改后,请尝试重新启动应用程序。

还要检查匹配模式。此外,通过允许CORS以参考文献中提到的任何方式来检查是否允许广泛的URL

  1. 弹簧靴安全胸衣
  2. 如何启用spring-boot-cors示例交叉原点
  3. /弹簧靴安全紧身胸衣

例如:

registry.addMapping("/*")
.allowedOrigins("*").allowedMethods("*");

作为一种变通方法,尝试添加<system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer>在web.config 中

最新更新