跨域问题及其解决方案整理(随时更新)
修改Nginx配置
在网站配置文件内添加如下内容:
server
{
listen 80;
index index.html index.htm index.php;
root /www/public/;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers "x-requested-with,Authorization,Accept, Origin, X-Requested-With, Content-Type, Last-Modified";
add_header Access-Control-Allow-Methods GET,POST;
add_header Access-Control-Max-Age 1728000;
}
To be continued...
评论 (1)