nginx允许跨域配置

配置如下

#允许跨域请求的域,*代表所有
add_header 'Access-Control-Allow-Origin' *;
#允许带上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' *;

 

 


 

(24条消息) nginx允许跨域的设置_wcuuchina的博客-CSDN博客_nginx 允许跨域

posted @ 2022-06-05 00:24  冬音  阅读(8956)  评论(0编辑  收藏  举报