码迷,mamicode.com
首页 > 其他好文 > 详细

打包到nginx

时间:2019-07-06 00:13:51      阅读:110      评论:0      收藏:0      [点我收藏+]

标签:指定   stop   highlight   root   HERE   查询   html   config   write   

1. 将dist打一个.zip包

2. 切换到跟目录上传文件并解压

3. 移动到指定文件夹中如web-vue

  whereis nginx  ----查询nginx所在文件目录

  pwd  ----当前路径

  vim nginx.config  ----编辑文件

4.修改nginx配置文件  

location / { 
     root /web-vue ; #/代表根 
     try_file $uri $uri/ /index.html;   # 找当前的url,否则找当前url的/,否则就找index.html
 } 

5. SPA项目需要配置rewrite ,或者try_file

6. 重启服务

      nginx -s reload

  nginx -s stop

  start nginx

 

打包到nginx

标签:指定   stop   highlight   root   HERE   查询   html   config   write   

原文地址:https://www.cnblogs.com/ihuangqing/p/11141136.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!