Skip to content

Commit

Permalink
Load module earlier, at the rewrite phase. (opentracing-contrib#85)
Browse files Browse the repository at this point in the history
Subrequests begin their lives in the server-rewrite phase, so this
module is still loaded for subrequests.
  • Loading branch information
terrynsun committed May 17, 2019
1 parent b56c1a9 commit 97dc0f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opentracing/src/ngx_http_opentracing_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static ngx_int_t opentracing_module_init(ngx_conf_t *cf) noexcept {

// Add handlers to create tracing data.
auto handler = static_cast<ngx_http_handler_pt *>(ngx_array_push(
&core_main_config->phases[NGX_HTTP_PREACCESS_PHASE].handlers));
&core_main_config->phases[NGX_HTTP_REWRITE_PHASE].handlers));
if (handler == nullptr) return NGX_ERROR;
*handler = on_enter_block;

Expand Down Expand Up @@ -305,4 +305,4 @@ static char *merge_opentracing_loc_conf(ngx_conf_t *, void *parent,
}

return NGX_CONF_OK;
}
}

0 comments on commit 97dc0f4

Please sign in to comment.