- 1)修改nginx服务器默认的报错页面
[root@nginx ~]# vim /usr/local/nginx/conf/nginx.conf
.. ..
error_page 404 /40x.html; //自定义错误页面
.. ..
[root@nginx ~]# vim /usr/local/nginx/html/40x.html //生成错误页面
Do not find page …
[root@nginx ~]# nginx -s reload
修改完配置文件一定要进行配置文件的重新加载
2)常见的http报错状态码
3)查看服务器的状态信息
第一步:安装的时候加载模块
[root@nginx nginx-1.12.2]# ./configure \
> --with-http_stub_status_module //开启status状态页面
[root@proxy nginx-1.12.2]# make && make install //编译并安装
安装nginx的时候添加上--with-http_stub_status_module模块
第二步:修改nginx的默认的配置文件
[root@nginx ~]# cat /usr/local/nginx/conf/nginx.conf
… …
location /status {
stub_status on; 打开显示nginx服务器状态
#allow IP地址;
#deny IP地址;
}
… …
[root@nginx ~]# nginx -s reload
记住