Welcome! Log In Create A New Profile

Advanced

Re: Writing a module to use with http_proxy

July 21, 2011 11:14AM
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.
Subject Author Posted

Writing a module to use with http_proxy

regall July 21, 2011 05:52AM

Re: Writing a module to use with http_proxy

regall July 21, 2011 06:04AM

Re: Writing a module to use with http_proxy

regall July 21, 2011 11:14AM

Re: Writing a module to use with http_proxy

regall July 21, 2011 11:21AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 145
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready