nginx php post限制,nginx + php 跨域问题,GET可以跨域成功,POST失败
生活随笔
收集整理的這篇文章主要介紹了
nginx php post限制,nginx + php 跨域问题,GET可以跨域成功,POST失败
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
我這邊用的nginx的
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Allow-Origin $http_origin always;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,PATCH,OPTIONS;
add_header Access-Control-Allow-Headers * always;
add_header Access-Control-Allow-Headers DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,Accept;
add_header Access-Control-Max-Age 1728000;
add_header Content-Length 0;
location / {
if ($request_method = 'OPTIONS') {
return 200;
}
}
總結
以上是生活随笔為你收集整理的nginx php post限制,nginx + php 跨域问题,GET可以跨域成功,POST失败的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 国外五大股票交易系统及其源码
- 下一篇: 搜狗详解“微信头条” 加速移动搜索正面进