This is a production IIS web server that has been up and running fine for a month. There are 6 sites on the server, and last week one site started to give random 500 errors. The was one of two site using URL Rewrite. We spent about 2 1/2 hours with a well versed consultant who could not give a definitive answer. The rewrite rule was:
<httpErrors existingResponse="PassThrough" />
<rewrite>
<rules>
<rule name="Redirect .cfm extension" stopProcessing="false">
<match url="^(.*).cfm$" ignoreCase="true" />
<conditions logicalGrouping="MatchAny">
<add input="{URL}" pattern="(.*).cfm$" ignoreCase="false" />
</conditions>
<action type="Redirect" url="{R:1}" redirectType="Permanent" />
</rule>
<rule name="hide .cfm extension" stopProcessing="true">
<match url="^(.*)$" ignoreCase="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}.cfm" matchType="IsFile" />
</conditions>
<action type="Rewrite" url="{R:0}.cfm" />
</rule>
</rules>
We removed that rule have have been trouble free since.
Now the other site using URL Rewrite is giving random errors, but this one is a bit more complicated to fix as it's or API.
<httpErrors existingResponse="PassThrough" />
<rewrite>
<rules>
<rule name="ApiWithControllerAndId" stopProcessing="true">
<match url="^([^/]+)/([^/]+)/([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.cfm?controller={R:1}&method={R:2}&id={R:3}" />
</rule>
<rule name="ApiWithController" stopProcessing="true">
<match url="^([^/]+)/([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.cfm?controller={R:1}&method={R:2}" />
</rule>
</rules>
</rewrite>
They come and go seemingly at random. There's nothing we've hit upon that can guarantee a 500 response. We have an identical staging server that has not given any 500 errors. I just enabled failed request tracing on this site but so far have no captured a 500 error.