本篇文章分析下nginx 显示默认首页的过程
如下图所示
查看config文件:
# 如果忘记nginx 安装目录。使用下面命令查看
[root@XXX]# whereis nginx
nginx: /usr/local/nginx
# 下面是config文件里面的内容片段
server {
listen 80;
server_name localhost;
location / {
#相对文件夹 和config同一个目录
root html;
# 指定首页页面
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}