个性网页404的做法

1.修改主配置文件:vim /etc/nginx/nginx.conf
error_page 404 /404.html; //写进去
个性网页404的做法_第1张图片
2.修改子配置文件: vim /etc/nginx/conf.d/default.conf
个性网页404的做法_第2张图片
3.在后边写入
location = /404.html {
root /usr/share/nginx/html;
}
个性网页404的做法_第3张图片
4.创建一个404的网页: vim /usr/share/nginx/html/404.html
个性网页404的做法_第4张图片
5.访问:输入ip地址10.8.162.6/adsajfojfosihdf(后边随便打)
个性网页404的做法_第5张图片