Dooy / chatgpt-web-midjourney-proxy

One UI is all done with chatgpt web, midjourney, gpts,suno,luma,runway,viggle,flux,ideogram; Simultaneous support Web / PWA / Linux / Win / MacOS platform
https://vercel.ddaiai.com
MIT License
4.72k stars 1.21k forks source link

Docker 部署 无法正常显示页面 #379

Closed Jkkoi closed 3 months ago

Jkkoi commented 3 months ago

在移动设备上,只会显示一个 Aha,其他地方都为空白 11

所用的 docker-compose 如下

services:
  chatgpt-web-midjourney-proxy:
    image: ydlhero/chatgpt-web-midjourney-proxy
    container_name: chatgpt-web-midjourney-proxy
    ports:
      - "3002:3002"
    environment:
      - OPENAI_API_KEY=sk-1145141919810
      - OPENAI_API_BASE_URL=https://example.com
      - API_UPLOADER=1  
      - HIDE_SERVER=1
      - SYS_NOTIFY=1
    restart: always

Nginx 部分配置如下:

    # reverse proxy
    location / {
        proxy_pass            http://chatgpt-web-midjourney-proxy:3002;
        proxy_set_header Host $host;
        proxy_http_version                 1.1;
        proxy_cache_bypass                 $http_upgrade;

        # Proxy SSL
        proxy_ssl_server_name              on;

        # Proxy headers
        proxy_set_header Upgrade           $http_upgrade;
        proxy_set_header Connection        $connection_upgrade;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header Forwarded         $proxy_add_forwarded;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host  $host;
        proxy_set_header X-Forwarded-Port  $server_port;

        # Proxy timeouts
        proxy_connect_timeout              60s;
        proxy_send_timeout                 60s;
        proxy_read_timeout                 60s;
    }

手机浏览器为 firefox 版本 125.3.0 (Build #2016017554),QQ微信内置浏览器存在同样问题

Jkkoi commented 3 months ago

补充:在我自己的电脑上都是显示正常的,但在别人电脑上就算电脑浏览器也无法显示 image

Jkkoi commented 3 months ago

添加 add_header Content-Security-Policy "default-src 'self' http: https: ws: wss: data: blob: 'unsafe-inline' 'unsafe-eval'"; 后正常

Dooy commented 3 months ago

你这个在 浏览器上运行的?

Dooy commented 3 months ago

为何 我用微信 访问 https://vercel.ddaiai.com 没问题?

Jkkoi commented 3 months ago

@Dooy 目前我测试出来的故障原因是因为标头 Content-Security-Policy 不包含 'unsafe-eval' 导致部分代码不能正常执行,我是通过 nginx 转发了一次以支持 https,可能 nginx 配置有误导致标头异常

Dooy commented 3 months ago

@Dooy 目前我测试出来的故障原因是因为标头 Content-Security-Policy 不包含 'unsafe-eval' 导致部分代码不能正常执行,我是通过 nginx 转发了一次以支持 https,可能 nginx 配置有误导致标头异常

这个像是在 iframe内执行 或者 浏览器插件内执行 这个错误?

Jkkoi commented 3 months ago

这个像是在 iframe内执行 或者 浏览器插件内执行 这个错误?

不是,就是在正常浏览器打开网页

Dooy commented 3 months ago

参考 service worker 有没有方法强制更新 #380

把 service worker 删除了