nginx学习(二):nginx显示默认首页解析过程

本篇文章分析下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;
        }

    }

posted @ 2019-12-15 19:03  Kevin_zheng  阅读(840)  评论(0编辑  收藏  举报