Loading

nginx 跨域配置

在conf的service里添加

#允许跨域请求的域,*代表所有
add_ header ' Access-Control-Allow-0rigin' *;
#允许带上cookie请求
add_ header ' Access-Control-Allow-Credentials' 'true';
#允许请求的方法,比如GET/POST/PUT/DELETE
add_ header ' Access-Control-Allow-Methods' *;
#允许请求的header
add_ header ' Access-Control-Allow-Headers' *;
posted @ 2020-05-17 15:10  摇橙子  阅读(4439)  评论(0编辑  收藏  举报