I'm trying to set up a custom error page (just a static 500.html page) using app.UseExceptionHandler("/500.html");. It works as expected when working locally (in env.IsDevelopment()), but when deployed to an Azure Web App, I still get til empty default browser error page. Anyone tried this, and have some pointers? It's Umbraco 12. There is nothing in web.config taking over either.
I have this as the first part of the Configure method in Startup.cs:
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/500.html");
app.Use(async (context, next) =>
{
// Detect and work around issue causing the error page not to be displayed:
if (context.Response.StatusCode == StatusCodes.Status500InternalServerError && context.Request.Path == "/500.html")
{
context.Features.Set<UmbracoRouteValues>(instance: null);
}
await next();
});
}