在nginx上部署页面,使用ip访问页面,实现跨设备访问本地静态页面

1、在nginx官网下载并安装nginx,下载链接:http://nginx.org/en/download.html。

2、修改安装包中conf文件夹中的nginx.conf的root路径,使用#将默认的路径注释掉,增加新的root路径,如下:  

  location / {
    #root html;
    root F:/weike/dazuoye;
    index index.html index.htm;
  }

3、命令行输入ipconfig查看本机ip地址

4、在pc端或移动端浏览器输入http://xxx.xxx.xxx.xxx:8080/index.html就可以在页面渲染F:/weike/dazuoye文件夹下的index.html页面了。

posted on 2017-04-05 21:48  萌动  阅读(863)  评论(0编辑  收藏  举报