nginx配置跨域访问

location / {  

  add_header Access-Control-Allow-Origin *;

  add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";

  add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";