查看nginx源码如下:
ngx_int_t
ngx_http_subrequest(ngx_http_request_t *r,
ngx_str_t *uri, ngx_str_t *args, ngx_http_request_t **psr,
ngx_http_post_subrequest_t *ps, ngx_uint_t flags)
{
。。。。。。。。。
sr->args = *args;
。。。。。。。。。
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http subrequest \"%V?%V\"", uri, &sr->args);
。。。。。。。。。
}
由debug日志可知此函数会根据uri和sr->args组成子请求,所以只需知道,uri和sr->args对应的传入参数即可
uri即ngx_http_subrequest的第二个参数,由sr->args = *args可知子请求的参数就是函数传入的第三个参数
nginx的subrequest子请求如何增加参数
最新推荐文章于 2024-11-04 08:00:00 发布