1. 当前位置:网站首页 > 技术分享 > linux

宝塔 Nginx 设置允许跨域访问 域名IP都可以跨域

选择允许跨域的网站,选择设置,注意不要直接去修改Nginx配置无效

1.png

增加允许跨域访问配置。

2.png

    add_header Access-Control-Allow-Origin *;
    add_header Access-Control-Allow-Headers Origin,Accept,Authorization,platformId,ut,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type;
    add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
    add_header Access-Control-Allow-Credentials true;



本文由网上采集发布,不代表我们立场,转载联系作者并注明出处:https://www.90175.com/wenku/txtlist_i206v.html

联系我们

在线咨询:点击这里给我发消息

微信号:76891828

工作日:9:30-18:30,节假日休息