npm run build后调用api返回index.html

https://img4.mukewang.com/5c1079a9000132d004730187.jpg

vue项目打包后生成static和index.html,然后配置nginx指向index.html,调用api的时候却返回index.html的内容

https://img3.mukewang.com/5c1079b70001fed805360448.jpg

开发的时候不会出现这样的问题,vue里面配置了proxyTable转发api到3000端口,nginx也需要配置转发api吗?

潇湘沐
浏览 797回答 1
1回答

GCT1015

你nginxlocation配置有问题咯location / {           index index.html;     }
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript