nginx解决跨域问题配置
只需在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;
ps: allow-headers 有很多值比如:Content-Type等,可以自行添加
ps:https://mp.weixin.qq.com/s/vU-ejo9efh2qHXYqcK7VxQ