nginx+apache 404错误页面

时间:2023-03-08 21:05:46
nginx+apache 404错误页面

公司新系统  随风做的  给客户演示出错不想让客户看到   自动返回上一页面。

刚开始按照网上说的 在nginx 处理:

# 定义错误提示页面
error_page 500 502 503 504 /50.html;
location = error/50.html {
root /var/www/website;
}

没有效果。后来想 后台apache应用处理错误,nginx只是反向代理。

在apache按照网上说的不行:

httpd.conf配置文件 添加

ErrorDocument 404 /404.php

后来发现  添加空控制类:

EmptyController.class.php  即可。