<div>Hi all:</div>
<div> </div>
<div>I try to implemente a module based on NGINX, which will filter the content of request body. </div>
<div>Now,  I met a problem: I can not get the whole request body</div>
<div> </div>
<div>my code is as following: </div>
<div>---------------------------------------------</div>
<div>   len = rb-&gt;buf-&gt;last - rb-&gt;buf-&gt;pos ;<br>   post_content = ngx_palloc(r-&gt;pool, len + 1);<br>   ngx_cpystrn(post_body, rb-&gt;buf-&gt;pos, len);</div>
<div>
<div>---------------------------------------------</div>
<div> </div>
<div>it seems that if the body size is over 256 Bytes, we can not get the right request body length. </div>
<div> </div>
<div>my questions are:</div>
<div>1) how can I get the correct length of request body ? </div>
<div>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 ? </div>
<div> </div>
<div> </div>
<div>Other issue:</div>
<div>I want to redirect some unsafe URLs to different safe URL, like </div>
<div> <a href="http://www.abc.com/a.index">http://www.abc.com/a.index</a> redirect to <a href="http://www.1234.com/a.index">http://www.1234.com/a.index</a></div>
<div><a href="http://www.abc.com/b.index">http://www.abc.com/b.index</a>  rediect to <a href="http://www.5566.com/b.index">http://www.5566.com/b.index</a> </div>
<div> </div>
<div>I use  the function: ngx_http_internal_redirect() to implementate,  but I always get a crash. </div>
<div>Any idea about these ? </div>
<div> </div>
<div> </div>
<div>thanks </div>
<div>NextHop. </div></div>