美文网首页
【nginx】 解决跨域问题

【nginx】 解决跨域问题

作者: miniy_7 | 来源:发表于2020-02-18 17:53 被阅读0次

nginx解决跨域问题加入如下代码header

add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';

eg:


image.png

相关文章

网友评论

      本文标题:【nginx】 解决跨域问题

      本文链接:https://www.haomeiwen.com/subject/pmfnfhtx.html