linux deployment vue project --nginx

First, upload a file package

  1. The compressed package dist.zip --- uploaded to the system such as linux / home / server / dist

  2. Extracting archive

cd /home/server/dist
##解压
unzip dist.zip
12320369-2e6e52006d6c009b.png
image.png

Second, the configuration nginx configuration file

  1. --------- determine suffix as host and contract staff

  2. cd /xxx/nginx/conf

  3. Edit nginx.conf vi nginx.conf

  4. niginx configuration increases

 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;
}
12320369-7753c6bd9d4bdda2.png
image.png
  1. Sbin directory to the next restart nginx nginx
./nginx  –s reload

Third, access the web site


12320369-fdbcd384696c579d.png
image.png

Guess you like

Origin blog.csdn.net/weixin_34293902/article/details/90942224