1. Dify 请求参数

    {
        "inputs": {
            "current_education": "本科"
        },
        "response_mode": "streaming",
        "user": "abc-123"
    }
    
  2. 现象

    1. Mac OS Curl 可以流返回(通过-v 可以查看更多详情)
    2. Mac OS 本地运行 node 程序 stream 也可以支持
    3. Mac OS ApiFox 不支持
    4. Centos 环境不支持,是流的格式,不过是最后一次性给到
  3. 解决方法

    1. https://github.com/langgenius/dify/issues/12904
    2. 入网可以有代理,出网一般都没问题,多半是代理问题

    Same question. I'm not sure if you're using an external NGINX proxy.

    相同问题。我不确定你是否在使用外部 NGINX 代理。

    If I access the Dify Docker instance directly using the internal NGINX address, there's no problem.

    如果我用 Dify Docker 实例的内部 NGINX 地址直接访问,就没有问题。

    However, if you're using an external NGINX proxy inside the container, you should set proxy_buffering off in the external NGINX's location block.

    然而,如果你在容器内使用外部 NGINX 代理,你应该在外部 NGINX 的位置块中设置 proxy_buffering off。

    location / {
        proxy_pass <http://your-dify-address>;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_http_version 1.1;
        proxy_set_header Connection '';
        # The key setting is proxy_buffering
        proxy_buffering off;
        proxy_cache off;
    }