博主头像
哎呀博客

Se-Ryong .Blog

BT 跨域配置

登录宝塔面板。

打开左侧菜单中的 网站,选择你的源站(cos.XXX.com)对应的网站设置。

切换到 配置文件 选项卡,找到 server {} 段落。

在合适的位置(比如 location 块中,或 server 中全局设置)添加如下内容:

nginx

location / {

add_header 'Access-Control-Allow-Origin' *;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization';
if ($request_method = 'OPTIONS') {
    return 204;
}

}

BT 跨域配置
https://aiya.blog/archives/48.html
本文作者 seryong
发布时间 2025-05-23
许可协议 CC BY-NC-SA 4.0

评论已关闭