nginx配置跨域
nginx,server或location段添加:
add_header Access-Control-Allow-Origin '*'; add_header Access-Control-Allow-Credentials "true"; add_header Access-Control-Allow-Methods '*'; add_header Access-Control-Allow-Headers '*'; if ($request_method = 'OPTIONS') { return 200; }