Re: [I] bug: 开发了一个插件,修改了server返回的流式响应的请求体,apisix一次响应不是一个chunk,而是累积几个chunk一起响应 [apisix]

2025-07-21 Thread via GitHub


clhey commented on issue #11977:
URL: https://github.com/apache/apisix/issues/11977#issuecomment-3096519117

   > [@bzp2010](https://github.com/bzp2010) 参考其他回答,增加了如下配置
   > 
   > ```
   > nginx_config:
   >   http_configuration_snippet: |
   > proxy_buffering off;
   > ```
   > 
   > 
可以解决问题,但是这个配置是全局的,有什么其他灵活的配置的方法么?比如nginx可以在location的位置配置。我的场景希望可以在对于处理header中含有"stream":
 true 请求,设置配置 proxy_buffering off;,可以帮忙看下apisix有办法配置吗?非常感谢
   
   For different routes or services, there should be different Nginx 
configurations. This is a common requirement — why doesn't APISIX support it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [I] bug: 开发了一个插件,修改了server返回的流式响应的请求体,apisix一次响应不是一个chunk,而是累积几个chunk一起响应 [apisix]

2025-04-02 Thread via GitHub


woniuxu commented on issue #11977:
URL: https://github.com/apache/apisix/issues/11977#issuecomment-2774437101

   > [@bzp2010](https://github.com/bzp2010) 参考其他回答,增加了如下配置
   > 
   > ```
   > nginx_config:
   >   http_configuration_snippet: |
   > proxy_buffering off;
   > ```
   > 
   > 
可以解决问题,但是这个配置是全局的,有什么其他灵活的配置的方法么?比如nginx可以在location的位置配置。我的场景希望可以在对于处理header中含有"stream":
 true 请求,设置配置 proxy_buffering off;,可以帮忙看下apisix有办法配置吗?非常感谢
   
   @GreatLazyMan 
   搜到一个通过在RealServer增加响应头"X-Accel-Buffering":"no" header的方式。
   参考:https://github.com/ChilliCream/graphql-platform/issues/7084
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [I] bug: 开发了一个插件,修改了server返回的流式响应的请求体,apisix一次响应不是一个chunk,而是累积几个chunk一起响应 [apisix]

2025-03-02 Thread via GitHub


juzhiyuan closed issue #11977: bug: 
开发了一个插件,修改了server返回的流式响应的请求体,apisix一次响应不是一个chunk,而是累积几个chunk一起响应
URL: https://github.com/apache/apisix/issues/11977


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [I] bug: 开发了一个插件,修改了server返回的流式响应的请求体,apisix一次响应不是一个chunk,而是累积几个chunk一起响应 [apisix]

2025-03-02 Thread via GitHub


juzhiyuan commented on issue #11977:
URL: https://github.com/apache/apisix/issues/11977#issuecomment-2693096917

   @ymichaelson, you can follow the link to update the Nginx configuration: 
https://github.com/apache/apisix/issues/11977#issuecomment-2677070001.
   
   @GreatLazyMan, there is a plugin (Enterprise) that allows you to disable 
proxy buffering dynamically. You can find more information at 
https://docs.api7.ai/hub/proxy-buffering.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [I] bug: 开发了一个插件,修改了server返回的流式响应的请求体,apisix一次响应不是一个chunk,而是累积几个chunk一起响应 [apisix]

2025-02-28 Thread via GitHub


qizhendong1 commented on issue #11977:
URL: https://github.com/apache/apisix/issues/11977#issuecomment-2690068458

   about this issue, it maybe nginx side, look this 
https://github.com/nginx/nginx/issues/316


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [I] bug: 开发了一个插件,修改了server返回的流式响应的请求体,apisix一次响应不是一个chunk,而是累积几个chunk一起响应 [apisix]

2025-02-26 Thread via GitHub


ymichaelson commented on issue #11977:
URL: https://github.com/apache/apisix/issues/11977#issuecomment-2684215762

   > ### Current Behavior
   > 开发了一个插件,修改了server返回的流式响应的请求体,apisix一次响应不是一个chunk,而是累积几个chunk一起响应 
已经尝试在route和nginx关闭cache,没有效果。示例代码
   > 
   > ### Expected Behavior
   > 期望在修改响应体后,可以流式的返回响应体
   > 
   > ### Error Logs
   > _No response  无响应_
   > 
   > ### Steps to Reproduce
   > 1.启动apisix和etcd 2.配置文件中配置自定义插件 3.启动测试服务器,可以返回流式响应 4.配置route和upstream 插件代码示例
   > 
   > local plugin_name = "extract-reasoning"
   > local core = require("apisix.core")
   > local cjson = require("cjson.safe")
   > local ngx = ngx
   > 
   > local schema = {
   > type = "object",
   > properties = {},
   > }
   > 
   > local _M = {
   > version = 1.0,
   > priority = 1000,
   > name = plugin_name,
   > schema = schema,
   > }
   > 
   > 
   > function _M.header_filter(conf, ctx)
   > -- 设置SSE响应头
   > ngx.header["Content-Type"] = "text/event-stream"
   > -- ngx.header["Cache-Control"] = "no-cache"
   > ngx.header["Connection"] = "keep-alive"
   > ngx.header["Cache-Control"] = "no-cache, no-store, must-revalidate"
   > ngx.header["Pragma"] = "no-cache"
   > ngx.header["Expires"] = "0"
   > end
   > 
   > function _M.body_filter(conf, ctx)
   > local chunk = ngx.arg[1]
   > local is_last = ngx.arg[2]
   > 
   > ngx.arg[1] = chunk
   > end
   > 
   > return _M
   > ### Environment
   > * APISIX version (run `apisix version`):APISIX 版本(运行 `apisix 版本`):
   > * Operating system (run `uname -a`):作系统(运行 `uname -a`):
   > * OpenResty / Nginx version (run `openresty -V` or `nginx -V`):OpenResty / 
Nginx 版本(运行 `openresty -V` 或 `nginx -V`):
   > * etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):etcd 版本(如果相关)(运行 `curl 
http://127.0.0.1:9090/v1/server_info` ):
   > * APISIX Dashboard version, if relevant:APISIX Dashboard 版本(如果相关):
   > * Plugin runner version, for issues related to plugin 
runners:插件运行程序版本,用于与插件运行程序相关的问题:
   > * LuaRocks version, for installation issues (run `luarocks 
--version`):LuaRocks 版本,针对安装问题(运行 `luarocks --version`):
   
   按照这个插件测试,没有达到预期的效果,还是累积多个chunk再返回,是还需要有什么配置吗?路由上已经配置了这个plugin


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [I] bug: 开发了一个插件,修改了server返回的流式响应的请求体,apisix一次响应不是一个chunk,而是累积几个chunk一起响应 [apisix]

2025-02-23 Thread via GitHub


GreatLazyMan commented on issue #11977:
URL: https://github.com/apache/apisix/issues/11977#issuecomment-2677070001

   @bzp2010  参考其他回答,增加了如下配置
   ```
   nginx_config:
 http_configuration_snippet: |
   proxy_buffering off;
   
   
可以解决问题,但是这个配置是全局的,有什么其他灵活的配置的方法么?比如nginx可以在location的位置配置。我的场景希望可以在对于处理header中含有"stream":
  true 请求,设置配置 proxy_buffering off;,可以帮忙看下apisix有办法配置吗?非常感谢


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [I] bug: 开发了一个插件,修改了server返回的流式响应的请求体,apisix一次响应不是一个chunk,而是累积几个chunk一起响应 [apisix]

2025-02-22 Thread via GitHub


bzp2010 commented on issue #11977:
URL: https://github.com/apache/apisix/issues/11977#issuecomment-2676345538

   1. 检查网关前的任何潜在L4/L7负载均衡器,确认它们是不是具有并开启了响应体缓冲。
   
   2. 如果网关前没有任何负载均衡器,则尝试使用自定义NGINX配置以关闭 proxy_buffering, 
https://apisix.apache.org/docs/apisix/customize-nginx-configuration/
   
   
   
   1. Check any potential L4/L7 load balancers in front of the gateway to 
confirm that they do not have response body buffering enabled.
   
   2. If there aren't any load balancers in front of the gateway, try using a 
custom NGINX configuration to turn off proxy_buffering, 
https://apisix.apache.org/docs/apisix/customize-nginx-configuration/


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]