好好风格的博客

一个好风格的博客,分享技术,分享生活,分享经验。

0%

Nginx解决跨域请求

在服务器端的nginx.conf中配置增加配置

1
2
3
4
5
6
7
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;
......
}