如何自定义 Azure Web App 403、503 错误页面? [英] How to customise Azure Web App 403, 503 error pages?
问题描述
我不知道如何呈现带有专业品牌的自定义错误页面,以涵盖以下错误:
I am at a loss as to how to present a custom error page, with professional branding, for errors covering:
403 - Wep App stopped - currently get blue page with Azure text.
503 - Service Unavailable - currently get white page with "service unavailable"
我曾尝试使用 CloudFlare 自定义错误页面,但这不起作用.对于 403,流量仍会通过 Azure 路由到 Azure,并在那里获得标准的 Azure 403 页面.
I have tried to use CloudFlare custom error pages, but this does not work. For a 403, traffic still gets routed throught to Azure, where it gets the standard Azure 403 Page.
一定可以吗?
推荐答案
Azure Web Apps 上可能发生两类 HTTP 错误:
There are two categories of HTTP errors that can happen on Azure Web Apps:
- 在运行您的网站的 Web Worker 上的 IIS 中发生的情况.
- 那些在它到达之前发生的事情.这包括网站已停止、正在重新启动或可能受到系统中某些其他问题影响的情况.
判断错误是 #1 还是 #2 的一种方法是打开 http 日志记录,并查看它是否被记录.只有 #1 会.
One way to tell if an error is #1 or #2 is to turn on http logging, and see if it gets logged. Only #1 will.
对于 #1,您可以使用标准技术自定义错误.但是对于#2,目前无法自定义 Azure 返回的页面.
For #1, you can customize errors using standard techniques. But for #2, there is currently no way for you do customize the pages returned by Azure.
这篇关于如何自定义 Azure Web App 403、503 错误页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!