我已经在我的Nginx服务器路由中设置了一个Vue项目。我想从子目录加载vue项目。
我已经在vue.config.js
中正确设置了publicPath
通过以下配置,我可以在浏览器中加载dist/index.html
,但是所有链接的文件都出现MIME类型错误。
直接在浏览器中访问css / js文件时,它会加载index.html而不是css文件,因此我认为这不是MIME类型问题,而是所有/ vue / *都在加载索引.html而不是.css,.js等
有什么想法吗?谢谢
location /vue {
try_files $uri $uri/ /frontend/dist/index.html?$args;
}