Question about request_body and redirect

quan nexthop quan.nexthop at
Wed Aug 19 13:33:03 MSD 2009

Hi all:

I try to implemente a module based on NGINX, which will filter the content
of request body.
Now,  I met a problem: I can not get the whole request body

my code is as following:
   len = rb->buf->last - rb->buf->pos ;
   post_content = ngx_palloc(r->pool, len + 1);
   ngx_cpystrn(post_body, rb->buf->pos, len);

it seems that if the body size is over 256 Bytes, we can not get the right
request body length.

my questions are:
1) how can I get the correct length of request body ?
2) Do I need copy the request body to a buffur and then filter? Does
serverar buff hold the data and link the buff-chain ?

Other issue:
I want to redirect some unsafe URLs to different safe URL, like redirect to  rediect to

I use  the function: ngx_http_internal_redirect() to implementate,  but I
always get a crash.
Any idea about these ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list