如何自定义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 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屋!