首页 > 系统相关 >nginx允许跨域配置

nginx允许跨域配置

时间:2022-11-23 00:01:28浏览次数:50  
标签:Control 跨域 header Access nginx add Allow 允许

配置如下

复制代码
#允许跨域请求的域,*代表所有
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' *;
   

 

转自:https://www.cnblogs.com/wintertone/p/16343175.html

 

标签:Control,跨域,header,Access,nginx,add,Allow,允许
From: https://www.cnblogs.com/javalinux/p/16916953.html

相关文章