解决The‘Access-Control-Allow-Origin‘ header contains multiple values‘*, ....‘, but only one is allowed

2021-12-06 20:19:02 浏览数 (1)

代码语言:javascript复制
报错内容:
 Access to XMLHttpRequest at ‘http://www.z…n.com/api/login’
 from origin ‘http://z…n.com’ has been blocked by CORS policy:
 The ‘Access-Control-Allow-Origin’ header contains multiple values
 ‘*, http://z…n.com’,
 but only one is allowed.

意思是: 已被CORS策略阻止:“Access Control Allow Origin”标头包含多个值* 但只有一个是允许的。

报错截图:

处理建议: (本案例服务器为nginx代理跨域) 不是前端,后台需要修改部分配置项。 nginx具体配置: 相关阅读 · 推荐 The ‘Access-Control-Allow-Origin’ header contains multiple values’*, *’, but only one is allowed. but only one is allowed(重复处理跨域请求)

以上就是关于“ The ‘Access-Control-Allow-Origin‘ header contains multiple values‘*, …‘, but only one is allowed.” 的全部内容。

0 人点赞