报错内容:

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”标头包含多个值*

但只有一个是允许的。

报错截图:解决The‘Access-Control-Allow-Origin‘ header contains multiple values‘*, ....‘, but only one is allowed_算法

处理建议:

(本案例服务器为nginx代理跨域)

不是前端,后台需要修改部分配置项。

nginx具体配置:

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