Nginx POST handler module caching response

Maxim Dounin mdounin at mdounin.ru
Wed Mar 26 12:14:58 UTC 2014


Hello!

On Tue, Mar 25, 2014 at 09:03:22PM +0100, Mapper Uno wrote:

> Hi,
> 
> I have written a small nginx module that processes POST request and
> sends back in response the same data that is received in POST request. I
> am testing this with curl utility and closely monitoring nginx log which
> is set to debug level.
> 
> (My module's server is listening on port 9000)
> 
> # curl --data "This is nginx helper forum" http://localhost:9000
> This is nginx helper forum
> 
> # curl --data "Ruby forum" http://localhost:9000
> This is ng
> 
> # curl --data "ngx" http://localhost:9000
> Thi
> 
> However, if I reload the nginx config (nginx -s reload), I see the
> correct string
> 
> # curl --data "Ruby forum" http://localhost:9000
> Ruby forum
> 
> When I look at the nginx log file, I can see the correct incoming data
> string every time in my handler. I also do ngx_pcalloc for my output
> buffer string.
> 
> However, why is the cached/stale buffer string returned by nginx in
> response. I tried to look up relevant config directive but failed to
> correlate to this behaviour.

Looks like you did something wrong.  It's highly unlikely though 
that somebody will be able to say what exactly without seeing your 
code.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list