2

This is the rewrite rule:

 <rewrite>
   <rules>
     <rule name="redirect all requests" stopProcessing="true">
       <match url="^(.*)$" ignoreCase="false" />
         <conditions logicalGrouping="MatchAll">
           <add input="{REQUEST_FILENAME}" 
                matchType="IsFile" 
                negate="true" 
                pattern="" 
                ignoreCase="false" />
         </conditions>
       <action type="Rewrite" url="index.html" appendQueryString="true" />
     </rule>
   </rules>
</rewrite>    

Both of the following files exist. One GET succeeds and the other throws a 500.

200

GET http://greenearth.game/node_modules/aurelia-leaflet/dist/amd/leaflet.js

500 (URL Rewrite Module Error.)

GET http://greenearth.game/node_modules/aurelia-open-id-connect/dist/amd/open-id-connect-role-filter.js 

The 500 error specifically is:

"Cannot add duplicate collection entry of type 'rule' with unique key attribute 'name' set to 'redirect all requests'".

Two questions:

  1. Why is the first file giving a 500?
  2. How can we make it a 200?

Putting <remove name="redirect all requests" /> at the top of the <rules> element answers #2 but not #1.

Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467

2 Answers2

6

Looks like there is another web.config that conflicts with your parent one in the /node_modules/aurelia-open-id-connect/ or its subdirectories dist and amd.

If detailed errors is enabled, the 500 error must locate the problematic web.config file.

Kul-Tigin
  • 16,728
  • 1
  • 35
  • 64
  • That was 100% it. Well done. The `Aurelia-open-id-connect` plugin does have a web.config with the same rule. I'm amazed at the insight of your answer. – Shaun Luttin Sep 11 '16 at 23:31
0

If its an angular app, for me, deleting main.js and uploading fresh one solved the issue.