记录一个cors nginx跨域配置
来源:互联网 发布:saas平台数据库设计 编辑:程序博客网 时间:2024/05/21 09:00
location / {
if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' 'http://10.140.10.40'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 200; } if ($request_method = 'POST') { add_header 'Access-Control-Allow-Origin' 'http://10.140.10.40'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; } if ($request_method = 'GET') { add_header 'Access-Control-Allow-Origin' 'http://10.140.10.40'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; } }
原文https://gist.github.com/michiel/1064640/b7db5296020cbaf102c0776bc37b1cdec13e1955
阅读全文
0 0
- 记录一个cors nginx跨域配置
- Nginx解决跨域问题(CORS)
- nginx通过CORS实现跨域
- 2. nginx CORS 的配置
- 10分钟入门跨域,10分钟入门nginx跨域配置代理转发和CORS
- CORS(跨域资源共享) 的配置
- CORS(跨域资源共享) 的配置
- CORS(跨域资源共享) 的配置
- CORS(跨域资源共享) 的配置
- CORS(跨域资源共享) 的配置
- tomcat7.0配置CORS(跨域资源共享)
- CORS(跨域资源共享) 的配置
- tomcat7.0配置CORS(跨域资源共享)
- tomcat配置cors实现跨域
- Java服务端 CORS 跨域配置
- SpringBoot配置CORS跨域访问
- 什么是跨域,Cors协议,spring cors
- tomcat下CORS(跨域资源共享) 的配置
- Android 光标只显示一次。
- 在Unity中使用DragonBones运行库
- SpringMVC之HttpMessageConverter&RestTemplate笔记(二)
- Sencha touch学习
- html文字滚动效果演示
- 记录一个cors nginx跨域配置
- 刷清橙OJ--A1031.画三角形1
- jquery封装插件的方法(转)
- mysql 别名delete
- ERP培训感悟:最好的服务并不是授人以鱼,而是授人以渔
- 33款可用来抓数据的开源爬虫软件工具
- 在51单片机上使用DHT11测温湿度
- 文件名
- word 制作流程图