nginx 实现跨域
2024-08-30 03:50:09
nginx 添加头部跨域。
location / {
add_header 'Access-Control-Allow-Origin' '*'; //允许的域
add_header 'Access-Control-Allow-Credentials' 'true'; //允许cookie
}
前端ajax session id 不一致问题:
$.ajax({
url:url,
xhrFields: {
withCredentials: true
},
crossDomain: true,
success:function(result){
alert(“test”);
},
error:function(){
}
});
最新文章
- 配置tomcat https
- WP8.1 C#代码 添加/获取Grid.ColumnDefinitions/RowDefinitions
- ESXi查询网卡的驱动和固件版本
- mysql西文字符大小写重复键问题的解决方法
- SWFUpload使用指南
- Codeforces Beta Round #97 (Div. 1)
- 运行Capture.exe找不到cdn_sfl401as.dll
- Web定时执行某个方法-网页获取
- Serializable Clonable
- c#中实现登陆窗口(无需隐藏)
- centos6 搭建hdwiki
- Abandoned country
- Linux下Birt、JTreeChart中文乱码问题解决办法
- [Swift]LeetCode541. 反转字符串 II | Reverse String II
- [Ionic] Error: No provider for Http! Error: No provider for Http!
- luoguP4035
- php 生成xml文件
- DRF框架之 serializers 序列化组件
- VUE CLI 3.0 安装及创建项目
- Oracle数据库查询优化(上百万级记录如何提高查询速度)