Search code examples
asp.netiisurl-rewritingproxyarr

IIS ARR overrides application custom 404


I have several web servers and the proxy based on IIS ARR to balance the load between the web servers. If user goes to not existing page web server returns custom "notfound" page with 404 status code (works correct if I do not use proxy) Unfortunately it has been overridden by the ARR and I see IIS standard 404 screen instead of returned from web server (as on picture http://i.snag.gy/v1xvY.jpg).

Does anyone know how this the overriding can be avoided to allow users see the custom 404 page?

Thanks in advance


Solution

  • Add

    <httpErrors existingResponse="PassThrough"/>
    

    to your web.config file. It should look something like this:

    <configuration>
      <system.webServer>
        <httpErrors existingResponse="PassThrough"/>
      </system.webServer>
    </configuration>
    

    If you're developing an ASP.NET application, put it in the application's web.config file, not the proxy's.