美文网首页收藏
CORS error解决方法

CORS error解决方法

作者: 老街老街 | 来源:发表于2022-07-26 17:04 被阅读0次

server
{
listen 80;
server_name xxxxx.com;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/project/public;

# 允许跨域GET,POST,DELETE HTTP方法发起跨域请求
add_header 'Access-Control-Allow-Origin' *;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accep,Origin,User-Agent,DNT,Cache-Control,X-Mx- 
ReqToken,X-Requested-With';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE';

相关文章

网友评论

    本文标题:CORS error解决方法

    本文链接:https://www.haomeiwen.com/subject/diwoirtx.html