IIS 7.5 = Nested web.config will not override custom error handling set in application level web.config

Viewed 1069

Running ColdFusion 11 (Update 7) and IIS 7.5

My site application/root level web.config:

<configuration>
    <system.webServer>
        <httpErrors errorMode="Custom" />
    </system.webServer>
</configuration>

My nested web.config file, which sits inside /api/eb :

<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
    </system.webServer>
</configuration>

When I visit a page that sits within the /api/eb sub-directory (e.g. 401.cfm) and trigger a 401 status code the server will return the Custom error handler response. My interpretation from the docs is that the nested web.config file should override the root web.config file but it clearly is not.

I've checked within the IIS applicationhost file and httpErrors overrideModeDefault is set to true. I also tried using a location tag within my root web.config file to do the same thing but it is also ignored unless I set the path to the wildcard character.

I'm out of ideas. Your help will be greatly appreciated. Thank you in advance.

1 Answers
Related