一、上传文件包
将压缩包dist.zip上传至linux系统下---如/home/server/dist
解压压缩包
cd /home/server/dist
##解压
unzip dist.zip
二、配置nginx配置文件
与发包人员确定后缀名---------如host
cd /xxx/nginx/conf
编辑nginx.conf vi nginx.conf
niginx配置增加
location /host{
alias /home/server/vue/dist/;
index index.html;
try_files $uri $uri/ /index.html last;
}
location /(后缀名){
alias 压缩包解压路径;
index index.html;
try_files $uri $uri/ /index.html last;
}
- 到nginx的sbin目录下重启nginx
./nginx –s reload
三、访问网址