Hello!
Here's an obvious mistake: the "return" directive runs in the
"rewrite" nginx request processing phase while the
"echo_read_request_body" runs in the "content" phase. The "rewrite"
phase *always* runs before "content" phase. So your
"echo_read_request_body" directive will never run because the "return
200" line short-circuits the request processing early (no matter how
you arrange their order in the nginx.conf configuration).
I suggest you read my nginx tutorials for directive processing order
and other topics to save troubles like this in the future:
http://openresty.org/#eBooks
> I solved the issue by removing "return 200;". The $request_body will not
> contain the POST body if there is "return 200;". It is okay when "return
> 200;" is removed.
This explains :)
> Not sure if it is bug or feature.
No, it's not a bug nor a feature. Just a consequence of misuse and
misunderstanding :)
Best regards,
-agentzh