JAVA、PHP、前端、APP、网站开发 - 开发技术学习

开发技术学习 » 服务器 » vue后端服务设置跨域

vue后端服务设置跨域

此文被围观1131日期: 2021-06-25 分类 : 服务器  标签:  ·····
set $origin '*';
    if ($http_origin) {
        set $origin "$http_origin";
    }

    add_header Access-Control-Allow-Origin "$origin";
    add_header Access-Control-Allow-Credentials "true";
    add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
    add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,
    If-Modified-Since,Cache-Control,Content-Type,Authorization,Authori-zation';
    
    if ($request_method = 'OPTIONS') {
        return 204;
    }


Navigating to current location


Response to preflight request doesn't pass access control check: The value o

站点声明:部分内容源自互联网,为传播信息之用,如有侵权,请联系我们删除。

© Copyright 2011-2024 www.kfju.com. All Rights Reserved.
超级字帖 版权所有。蜀ICP备12031064号