【Nginx】部署静态页面网站(全程使用用户root)


【安装方法】

请参考:

【修改nginx.conf】

#cd /usr/local/nginx/conf

#vi nginx.conf

把第一项改为user root

找到server中的location中root,将值改为/root

  server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;


        #access_log  logs/host.access.log  main;

        location / {
            root   /root;
            index  index.html index.htm;
        }

这项修改的意思就是去找/root/index.html,

之后保存退出,然后在/root下创建一个index.html文件,内容自定。

之后启动nginx,以下网页就出来了。

END