I've tried to start and I faced a 'segmentation fault' error. I tried to add handler to NGX_HTTP_ACCESS_PHASE and that causes segmentation fault. Here's the code. Init function is called from merge_loc_conf function...
// auth check handler
static ngx_int_t ngx_http_zd_aws_proxy_check(ngx_http_request_t *r)
{
return NGX_HTTP_FORBIDDEN;
}
// Config initializer, adds core handler to check auth
static ngx_int_t ngx_http_zd_aws_proxy_init(ngx_conf_t *cf)
{
ngx_http_handler_pt *h;
ngx_http_core_main_conf_t *cmcf;
cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
h = ngx_array_push(&cmcf->phases[NGX_HTTP_ACCESS_PHASE].handlers);
if (h == NULL) {
return NGX_ERROR;
}
*h = ngx_http_zd_aws_proxy_check;
return NGX_OK;
}
Any thoughts on that ?
Thank you.