nginx允许跨域

add_header 'Access-Control-Allow-Origin' '*';

 

server里面粘贴

 

add_header 'Access-Control-Allow-Origin' 'https://example.com';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';

相关文章

#js
评论(0)
游客的头像
表情
全部评论
最新