解决The‘Access-Control-Allow-Origin‘ header contains multiple values‘*, ....‘, but only one is allowed
Posted Maynor的大数据奋斗之路
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决The‘Access-Control-Allow-Origin‘ header contains multiple values‘*, ....‘, but only one is allowed相关的知识,希望对你有一定的参考价值。
报错内容:
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.” 的全部内容。
以上是关于解决The‘Access-Control-Allow-Origin‘ header contains multiple values‘*, ....‘, but only one is allowed的主要内容,如果未能解决你的问题,请参考以下文章
The method xx from the type xx refers to the missing type List等问题的解决办法
Listener refused the connection with the following error 错误解决