一般情况下,我们跨域请求或者跨域上传,都需要修改nginx的配置文件
比如设计跨域上传:
WechatIMG398.jpeg
如果你的反向代理是Nginx的话 跨域修改nginx下的vhost文件夹下you_conf
cd /you_name_nginx_dir/conf/vhost/
vim you_name.conf
location / {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'OPTION, POST, GET';
add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Content-Type';
try_files $uri $uri/ /index.php?$query_string; //针对lumen与Laravel框架
}