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裏面又轉發了一次。頭沒帶過來