美文网首页
跨域响应头设置

跨域响应头设置

作者: 麦子_FE | 来源:发表于2016-09-10 17:41 被阅读757次

项目中大家可能不是一个网段。除了给chrome添加--disable-web-security外,后端的相应头应该如下设置

Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type
Access-Control-Allow-Methods:GET, POST, OPTIONS
Access-Control-Allow-Origin:*
Cache-Control:no-cache
Connection:keep-alive
Content-Type:application/json
Date:Sat, 10 Sep 2016 09:26:59 GMT
Server:nginx/1.8.0
Transfer-Encoding:chunked

Access-Control-Allow-Origin:*!!!!!!!!!!!必须加上

相关文章

网友评论

      本文标题:跨域响应头设置

      本文链接:https://www.haomeiwen.com/subject/rfnyettx.html