ajax跨域访问解决

ajax访问域名遇见的跨域问题,在被访问的nginx配置文件上的http节点加上下面几句话就好了。

 add_header Access-Control-Allow-Origin  *;
 add_header Access-Control-Allow-Headers X-Requested-With;
 add_header Access-Control-Allow-Methods GET,POST,OPTIONS;

猜你喜欢

转载自blog.csdn.net/u010316188/article/details/83834799