nginx配置指定的错误页面

环境:centos、nginx

在nginx代理的后台服务不可达的时候,指定nginx访问固定的500页面

1、nginx.conf在server模块添加如下配置

vi /usr/local/nginx/conf/nginx.conf              #server模块添加如下内容    
error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }

2、配置50x.html网页

vi /usr/local/nginx/html/50x.html
   --修改成自己需要的报错内容

 

posted @ 2020-08-04 15:19  苍茫宇宙  阅读(2334)  评论(0编辑  收藏  举报