hi 章老师, 有个主请求, 想开多个子请求,但是发现子请求只能是GET,貌似不支持POST? 不知道是我没找到还是不支持?
Hello! On Sun, Aug 16, 2015 at 11:05 PM, Lucien Li wrote: > 章老师, 有个主请求, 想开多个子请求,但是发现子请求只能是GET,貌似不支持POST? 不知道是我没找到还是不支持? > 只是默认是 GET 而已。ngx_echo 模块的 echo_subrequest 配置指令就支持多种 HTTP 方法,见: https://github.com/openresty/echo-nginx-module#echo_subrequest 类似地,ngx_srcache 模块的 srcache_fetch 和 srcache_store 也支持多种不同的 HTTP 方法的子请求: https://github.com/openresty/srcache-nginx-module#srcache_fetch https://github.com/openresty/srcache-nginx-module#srcache_store 另外,ngx_lua 模块提供的 ngx.location.capture 这个子请求接口也支持用户指定子请求的 HTTP 方法: https://github.com/openresty/lua-nginx-module#ngxlocationcapture 或许你应当考虑复用现有的 nginx C 模块而不是自己重新发明轮子。毕竟子请求自己在 C 级别上处理起来还是很复杂的,很难搞对。 Regards, -agentzh