首页 > 其他 > 详细

nginx虚拟机的配置

时间:2019-06-08 09:08:03      阅读:96      评论:0      收藏:0      [点我收藏+]

一、添加文件

 /var/wwwroot/site1/index.html,内容保存为
<?php

phpinfo();

二、找到nginx的配置文件,我的配置文件是  /etc/nginx/conf.d/default.conf

三、把default.conf内容修改为

server {

    listen       80;

    server_name  www.test.com;

 
    location / {

        root   /var/wwwroot/site1;

        index  index.html index.htm index.php; 

    }

}

 四、重启nginx

service nginx restart

五、打开浏览器,输入www.test.com,会看到输出phpinfo的信息

nginx虚拟机的配置

原文:https://www.cnblogs.com/ivy-zheng/p/10989752.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!