nginx 跨域配置

add_header "Access-Control-Allow-Methods" "GET,POST,OPTIONS,PUT,DELETE";
add_header "Access-Control-Allow-Credentials" "true";
add_header "Access-Control-Allow-Origin" "$http_origin";
add_header "Access-Control-Allow-Headers" "prelogid,Authorization,DNT,User-Agent,Keep-Alive,Content-Type,accept,origin,X-Requested-With,traceid,rpcid";



more_set_headers 'Access-Control-Allow-Origin:*' 'Access-Control-Allow-Credentials:true' 'Access-Control-Allow-Methods:HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS, TRACE' 'Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type, Accept, Cache-Control, Token, Code' 'Access-Control-Expose-Headers:Content-Disposition';
posted @ 2022-05-09 14:02  大川哥  阅读(720)  评论(0编辑  收藏  举报