NGINX支持跨域配置

年爸 1年前 ⋅ 686 阅读

说明:项目需要使用NGINX跨支持,记录一下。在需要跨域的节点中配置即可!

add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET,POST';
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,Origin,Accept';

全部评论: 0

    我有话说: