Nginx 跨域

在server下配置

#许跨域请求的域,*代表所有
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 @ 2022-04-13 17:57  YonchanLew  阅读(33)  评论(0)    收藏  举报