if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
#
# Tell client that this pre-flight info is valid for 20 days
#
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
} }

最新文章

  1. [.NET领域驱动设计实战系列]专题六:DDD实践案例:网上书店订单功能的实现
  2. leetcode-Combinations 复习复习排列组合
  3. float 在内存中如何存储的
  4. Maven简介
  5. 在centos7中限制kvm虚拟机可访问的资源
  6. php中的修饰符
  7. 小结OC中Retain cycle(循环引用)
  8. 根据list<Object>中的某个字段排序
  9. C++知识点整理——持续更新
  10. A Byte of Python 笔记(4)控制流:if、for、while、break、continue
  11. C# 8.0的三个令人兴奋的新特性
  12. Vue components Cannot read property '__ob__' of undefined
  13. C++进阶:新人易入的那些坑 --1.常量、常指针和指针常量
  14. 【Java并发.4】对象的组合
  15. HTTP响应过程
  16. Golang依赖管理工具:glide从入门到精通使用
  17. webpack打包二进制文件报错
  18. pyqt5界面切换
  19. [bzoj 4196][NOI 2015]软件包管理器
  20. 【转】Entity Framework教程(第二版)

热门文章

  1. 命令行运行Java程序时出现错误
  2. php 中的引用(&)与foreach结合后的一个注意点
  3. Asp.net core 框架整理
  4. c 浮点科学计数法
  5. django相关命令
  6. SPFA/Dijkstra POJ 3013 Big Christmas Tree
  7. UVa 11437 (梅涅劳斯定理) Triangle Fun
  8. 金蝶Apusic中间件适配JetSpeed2过程记录
  9. PWA之push服务
  10. Oozie的架构