Nginx 跨域问题

错误信息:

Access to XMLHttpRequest at ’ ’ from origin ’ ’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: The ‘Access-Control-Allow-Origin’ header contains multiple values ‘*, *’, but only one is allowed.

原因:

此错误原因是 项目代码中解决跨域代码 跟 Nginx 配置文件nginx.conf 中跨域 重复了;

解决方法:

去掉 其中一个即可,我去掉的是nginx.conf 中的跨域代码

你可能感兴趣的:(Nginx)