自定义Nginx错误界面跳转
1、开启Nginx.conf配置文件下的自定义接口参数。
http {
fastcgi_intercept_errors on;
}
2、在Server区域添加自定义的错误页。
# 调用指定错误文件 server { error_page 404 /404.html } # 调动指定错误访问地址 server { error_page 404 =http://www.xxx.com/404.html }
3、重启测试
注:500错误与404处理方式相同。error_page 500 502 503 504 /50x.html; 。