laravel-s
接口跨域
has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested
nginx
配置里面添加头
location @laravels {
........................................................
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Credentials: true;
........................................................
}
原因分析
一般在
index.php
设置头就可以了,但laravel-s
在nginx里面又转发了一次。头没带过来