https://www.jianshu.com/p/1080014a234f(跨域配置)

 

问题现象

Access to XMLHttpRequest at 'https://api.gstianfu.com/public/fund/announce_detail?aid=654247428725' from origin 'https://mobile.igesafe.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed.

nginx跨域(The 'Access-Control-Allow-Origin' header contains multiple values '*, *)

 

 nginx跨域(The 'Access-Control-Allow-Origin' header contains multiple values '*, *)

 

 

原因:加跨域时,直接在server块中添加,

nginx跨域(The 'Access-Control-Allow-Origin' header contains multiple values '*, *)

 

 

解决方法:哪个URL需要跨域,就在那个域名下添加

nginx跨域(The 'Access-Control-Allow-Origin' header contains multiple values '*, *)