nginx配置允许跨域访问
location ~ .*\.(php|php5)?$
{
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type, Authorization';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS';
if ($request_method = 'OPTIONS') {return 204;}
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}