文章详情页
项目打包上传配置完nginx后无法返回json数据
问题描述
本来应该返回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 }
问题解答
回答1:看上面报错,是你返回的不是一个正确的json,贴下你后端的吐数据的接口吧
相关文章:
1. mac里的docker如何命令行开启呢?2. docker start -a dockername 老是卡住,什么情况?3. docker-compose 为何找不到配置文件?4. docker images显示的镜像过多,狗眼被亮瞎了,怎么办?5. docker pull 错误?6. macos - mac下docker如何设置代理7. 在windows下安装docker Toolbox 启动Docker Quickstart Terminal 失败!8. mac连接阿里云docker集群,已经卡了2天了,求问?9. docker镜像无法删除,请求解决办法。10. node.js - 来帮我捋一下node中fs模块watch实现原理
排行榜