GPT访问跨域如何解决呢?

在服务器部署了gpt
参考这个
但是访问不到

后面我在docker启动了nginx代理

bash 复制代码
user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;

    server {
        listen 8899;
        server_name gpt;

        location / {
            add_header Access-Control-Allow-Origin "http://xx.xx.xx.xx:8899"; # 将请求代理到本地的 docker 应用程序运行的端口
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With';
    add_header 'Access-Control-Allow-Credentials' 'true';
    if ($request_method = 'OPTIONS') {
        add_header 'Access-Control-Max-Age' 1728000;
        add_header 'Content-Type' 'text/plain charset=UTF-8';
        add_header 'Content-Length' 0;
        return 204;
    }

        }
    }
	
}

还是未能解决这个上述问题,这是为何呢?

相关推荐
回忆2012初秋38 分钟前
【Nginx】优雅地走进高性能 Web 服务器世界(1)
服务器·前端·nginx
java知路1 小时前
linux yum 下载docker安装包及依赖安装包,并离线安装
linux·运维·docker
没有退路那我就不要散步2 小时前
kube-proxy优化
docker·容器·kubernetes
難釋懷2 小时前
Nginx-KeepAlive
运维·nginx
不大姐姐AI智能体2 小时前
实测教程:用 Codex 配合 HyperFrames,把公众号文章做成可渲染的讲解型视频
人工智能·经验分享·gpt·自动化·aigc
诺***帝2 小时前
GPT-Image-2多轮编辑功能完全教程:2026年从入门到精通
人工智能·gpt
2401_834636992 小时前
Keepalived + LVS (DR) + Nginx + NFS 高可用 Web 集群部署实战手册
前端·nginx·lvs
ai产品老杨3 小时前
解耦安防碎片化:基于 Docker 与边缘计算的 AI 视频管理平台架构演进(附 GB28181/RTSP 统一接入与源码交付实践)
人工智能·docker·边缘计算
ai产品老杨3 小时前
基于 Docker 与边缘计算的智能安防架构:解耦 GB28181/RTSP 多协议接入与异构芯片部署(附源码交付与 95% 降本实践)
docker·架构·边缘计算
xiami_world4 小时前
私有化部署协同白板选型指南:从Docker容器化到信创全栈适配的架构实践
运维·人工智能·docker·ai·持续部署