由于 azure 错误,无法访问特定的 rest api
Unable to access specific rest apis due to azure error
我的应用程序使用 spring 休息并部署在 Azure 服务器中。使用 spring rest.
创建了 rest api
除了一种情况外,我能够访问所有其他 URL。
例如:http://mydomain123.com/api/abc
、http://mydomain123.com/api/xyz/abc
可以访问以上网址
http://mydomain123.com/api/bin
, http://mydomain123.com/api/xyz/bin
, http://mydomain123.com/api/bin/dfdff
但是上面有 bin 词的 url 出现以下错误:
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 文件放在应用程序的根目录下 folder.And 进行更改后尝试重新启动应用程序。
同时检查 匹配模式。
还要通过以此处参考文献中提到的任何方式允许 CORS 来检查以允许广泛的 url
例如:
registry.addMapping("/*")
.allowedOrigins("*").allowedMethods("*");
作为变通方法尝试添加
<system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer>
在 web.config
我的应用程序使用 spring 休息并部署在 Azure 服务器中。使用 spring rest.
创建了 rest api除了一种情况外,我能够访问所有其他 URL。
例如:http://mydomain123.com/api/abc
、http://mydomain123.com/api/xyz/abc
可以访问以上网址
http://mydomain123.com/api/bin
, http://mydomain123.com/api/xyz/bin
, http://mydomain123.com/api/bin/dfdff
但是上面有 bin 词的 url 出现以下错误:
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 文件放在应用程序的根目录下 folder.And 进行更改后尝试重新启动应用程序。
同时检查
例如:
registry.addMapping("/*")
.allowedOrigins("*").allowedMethods("*");
作为变通方法尝试添加
<system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer>
在 web.config