nginx 配置跨域

location / { 
    add_header Access-Control-Allow-Origin * always;
        add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS' always;
         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' always;
          if ($request_method = 'OPTIONS') {
                    return 204;
        }
        proxy_pass http://localhost:9000;
}

 

上一篇:2021-02-20


下一篇:项目更改版本号之后打包失败 resolution will not be reattempted until the update interval of nexus has elapsed or u