##Nginx允许跨域 在站点配置文件中的server节点下,加入以下内容以允许跨域请求。

# 允许跨域请求的域, * 表示所有
add_header 'Access-Control-Allow-Origin' *;
# 允许携带Cookie
add_header 'Access-Control-Allow-Credentials' 'true';
# 允许请求的方式 比如常用的Restful GET/PUT/POST/DELETE
add_header 'Access-Control-Allow-Methods' *;
# 允许请求的header
add_header 'Access-Control-Allow-Headers' *;