当前位置:Gxlcms > PHP教程 > nginx配置ajax跨域访问php

nginx配置ajax跨域访问php

时间:2021-07-01 10:21:17 帮助过:22人阅读

  1. server { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE'; add_header PS 1; location / { }}

参考:

http://stackoverflow.com/questions/18450310/nginx-add-header-not-working

人气教程排行