返回错误代码后Nginx显示自定义错误页面?

时间:2018-02-20 06:30:16

标签: nginx block custom-error-pages

error_page 406 /abs/path/to/error.ie.html; 块内,我定义了以下错误页面:

if ($http_user_agent ~* (MSIE|Trident|wget|curl|libwww-perl) ) {
    return 406;
}

此外,以下条件阻止IE:

location

它成功阻止了默认{{1}}的执行,但返回了nginx 406错误页面而不是自定义html。

如何返回自定义html?

0 个答案:

没有答案
相关问题