在我们访问文件的时候,会出现 No 'Access-Control-Allow-Origin' header is present on the requested resource.之类的提示,遇到这种问题最简单的方式就是在服务器进行配置
http {
###start####
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
###end ###
}
重启nginx即可!