Nginx配置error_page 404 500等自定义的错误页面
2018-07-18 18:07
1271 查看
Nginx 做web server时, laravel 5.5框架开发,开发中发现有时候的网站代码有错误,我们需要跳转到一个指定内容的错误页面:
1. 在nginx.conf配置文件上加上一句:
fastcgi_intercept_errors on;
2. 服务中加上:
error_page 400 401 402 403 404 405 408 410 412 413 414 415 500 501 502 503 504 506 /404.html;
location = /404.html {
#放错误页面的目录路径。
root /root/learning_system_back_v2.0/public;
}
重启nginx:
systemctl restart nginx
500的错误界面显示跳转到自定义的400.html了。
1. 在nginx.conf配置文件上加上一句:
fastcgi_intercept_errors on;
2. 服务中加上:
error_page 400 401 402 403 404 405 408 410 412 413 414 415 500 501 502 503 504 506 /404.html;
location = /404.html {
#放错误页面的目录路径。
root /root/learning_system_back_v2.0/public;
}
重启nginx:
systemctl restart nginx
500的错误界面显示跳转到自定义的400.html了。
相关文章推荐
- nginx 设置错误的自定义404页面跳转到500
- django的403/404/500错误自定义页面的配置
- Tomcat配置400/404/500自定义错误页面
- nginx 设置错误的自定义404页面跳转到500
- nginx 设置错误的自定义404页面跳转到500
- spring mvc配置自定义错误404,500页面
- django的403/404/500错误自定义页面的配置
- Yii自定义错误页面(403,404)和NGINX 配置404错误页面转向
- nginx 自定义404 500 错误页面
- NGINX下配置404错误页面的方法分享
- 404,500等错误页面配置
- 在Tomcat中配置404自定义错误页面全解
- Servlet配置自定义404,500页面
- SSM中web.xml中配置错误页面时<error-page> ()报错
- NGINX 配置404错误页面转向
- JSP 404 ErrorPage 自定义页面处理
- NGINX 配置404错误页面转向
- tomcat 可以在web.xml当中配置404 自定义错误页面
- NGINX 配置404错误页面转向
- java 页面错误转发提示页面 errorPage转跳报HTTP500内部服务器错误