0

My application using spring rest and deployed in Azure server. Created rest apis using spring rest.

Am able to access all rest urls, except in one scenario.

for eg: http://mydomain123.com/api/abc , http://mydomain123.com/api/xyz/abc

Am able to access above urls

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

But above urls having bin word with which am getting below error:

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

I am trying as below,but not working at all:

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

Please someone help me out to fix above issue (I should be able to access rest apis even having word "bin" in it)

john
  • 15
  • 8

1 Answers1

0

Please make sure to place the web.config file at the root of the application folder.And after making changes try to restart the application.

Also check this for matching pattern . Also check to allow wide range of urls by allowing CORS in any of the ways mentioned in references here

  1. spring-boot-security-cors
  2. how-to-enable-spring-boot-cors-example-crossorigin
  3. /spring-boot-security-cors

ex:

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

And as a workaround try to add <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> in web.config

kavyaS
  • 8,026
  • 1
  • 7
  • 19