大家好,我是新手,我想通过openresty 来修改 返回数据的response body部分,应该如何实现?
大家好,我是新手,我想通过openresty 来修改 返回数据的response body部分,应该如何实现? --
有两种方式:1. ngx_lua 的 body_filter_by_lua,参考:https://github.com/openresty/lua-nginx-module/#body_filter_by_lua2. replace-filter-nginx-module 模块,参考:https://github.com/openresty/replace-filter-nginx-module#synopsis --smallfish http://chenxiaoyu.org On Fri, Jul 4, 2014 at 1:11 PM, flyer <new...@126.com> wrote: 大家好,我是新手,我想通过openresty 来修改 返回数据的response body部分,应该如何实现? -- --
非常感谢 smallfish,我学习一下。在 2014-07-04 01:14:54,"smallfish" <small...@gmail.com> 写道: 有两种方式:1. ngx_lua 的 body_filter_by_lua,参考:https://github.com/openresty/lua-nginx-module/#body_filter_by_lua 2. replace-filter-nginx-module 模块,参考:https://github.com/openresty/replace-filter-nginx-module#synopsis --smallfish http://chenxiaoyu.org On Fri, Jul 4, 2014 at 1:11 PM, flyer <new...@126.com> wrote: 大家好,我是新手,我想通过openresty 来修改 返回数据的response body部分,应该如何实现? -- -- --
有两种方式:1. ngx_lua 的 body_filter_by_lua,参考:https://github.com/openresty/lua-nginx-module/#body_filter_by_lua 2. replace-filter-nginx-module 模块,参考:https://github.com/openresty/replace-filter-nginx-module#synopsis --smallfish http://chenxiaoyu.org On Fri, Jul 4, 2014 at 1:11 PM, flyer <new...@126.com> wrote: 大家好,我是新手,我想通过openresty 来修改 返回数据的response body部分,应该如何实现? -- --
推荐使用后者(replace-filter-nginx-module),PS:如果是proxy后端,需要注意 Header 是否有 gzip 压缩,开启的话需要移除下这个头。--smallfish http://chenxiaoyu.org 2014-07-04 13:16 GMT+08:00 flyer <new...@126.com>: 非常感谢 smallfish,我学习一下。在 2014-07-04 01:14:54,"smallfish" <small...@gmail.com> 写道: 有两种方式:1. ngx_lua 的 body_filter_by_lua,参考:https://github.com/openresty/lua-nginx-module/#body_filter_by_lua 2. replace-filter-nginx-module 模块,参考:https://github.com/openresty/replace-filter-nginx-module#synopsis --smallfish http://chenxiaoyu.org On Fri, Jul 4, 2014 at 1:11 PM, flyer <new...@126.com> wrote: 大家好,我是新手,我想通过openresty 来修改 返回数据的response body部分,应该如何实现? -- -- -- --