vue打包项目后刷新404的问题Nginx配置

server { 
  listen   80; 
  server_name localhost; 
  index index.html; 
  root /root/dist; 
  location / { 
    root /root/dist; 
    try_files $uri $uri/ /index.html =404; 
  } 

   location /test { 
    root /root/dist; 
    try_files $uri $uri/ /test/index.html =404; 
  }
} 

 

posted @ 2019-09-26 16:45  图生  阅读(793)  评论(0)    收藏  举报