欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

nginx 配置ajax跨域访问php

程序员文章站 2022-05-01 18:10:32
...
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://*.com/questions/18450310/nginx-add-header-not-working