atom feed4 messages in ru.sysoev.nginxRe: Writing a module to use with http...
FromSent OnAttachments
regallJul 21, 2011 2:51 am 
regallJul 21, 2011 3:03 am 
regallJul 21, 2011 8:13 am 
regallJul 21, 2011 8:20 am 
Subject:Re: Writing a module to use with http_proxy
From:regall (ngin@nginx.us)
Date:Jul 21, 2011 8:13:54 am
List:ru.sysoev.nginx

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.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,212741,212762#msg-212762