INNER CODE UNIT · Rust
http_ctx
nginx/nginx-gateway-fabric · internal/controller/nginx/modules/rust/ai-guardrails/src/lib.rs:77
let http_ctx = (*cf).ctx as *mut ngx_http_conf_ctx_t;
if http_ctx.is_null() {
ngx_conf_log_error!(NGX_LOG_ERR, cf, "guardrails: null http conf ctx");
return Status::NGX_ERROR.into();
}
let core_ctx_index = ngx_http_core_module.ctx_index;
let cmcf = *(*http_ctx).main_conf.add(core_ctx_index) as *mut ngx_http_core_main_conf_t;
if cmcf.is_null() {
ngx_conf_log_error!(NGX_LOG_ERR, cf, "guardrails: could not get core main conf");
return Status::NGX_ERROR.into();
}
let handlers =
&mut (*cmcf).phases[ngx_http_phases_NGX_HTTP_ACCESS_PHASE as usize].handlers;
let h = ngx::ffi::ngx_array_push(handlers) as *mut ngx_http_handler_pt;
if h.is_null() {
ngx_conf_log_error!(
NGX_LOG_ERR,
cf,