Iis – Application Request Routing for IIS and custom error pages when server is offline

arrasp.netiis

I was wondering if there is a way to display a custom error page when something goes wrong with my server farm using Application Request Routing for IIS.

For example let's assume that all my servers in my server farm goes to unhealthy status and I wish to display a friendly error message to users and not the default 502.4 – Bad Gateway error message till I found what is wrong.

Is there a way to do that?

Best Answer

Yes, on the ARR server, for the website that first catches the request (Default Web Site by default), set a custom error page of 502.4. You can set another one for 502.3 for timeout situations.

Note that by default it will show the detailed error message on the local server, essentially ignoring your custom page. So, either test off-box or change the custom errors settings.