本来应该返回json数据,却返回了index.html,项目在本地跑是可以的,但是发到服务器上后就出现了这样的错误,求解
nginx配置
server {
listen 80;
server_name www.xxxx.cn;
root /data/www/blog/;
location / {
try_files $uri $uri/ /index.html;
}
}
服务器的打包后目录为static和index.html, 代理到打包后的index.html,所以为text/html
/etc/nginx/mime.types配置
type {
text/html html htm shtml
}
看上面报错,是你返回的不是一个正确的json,贴下你后端的吐数据的接口吧