javascript - vue 路由使用/index.html/home不起作用,用/home就可以
本文介绍了javascript - vue 路由使用/index.html/home不起作用,用/home就可以的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
我npm run build之后打包的文件放在nginx服务器下,用localhost可以访问,用localhost/index.html就无法访问,求助这是什么问题啊
解决方案
在nginx上加上
location / {
#这个地方指定被访问的文件夹位置
root /data/test;
index index.html index.htm;
}
试试看
这篇关于javascript - vue 路由使用/index.html/home不起作用,用/home就可以的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文