echo-nginx-module icon indicating copy to clipboard operation
echo-nginx-module copied to clipboard

Cannot post large body.

Open azuryyu opened this issue 8 years ago • 3 comments

I found that echo-module cannot print nginx log when I post a large body,(not so large, such as more than 20K);

Everything works fine if I post a client body smaller than 1kb, there are good Nginx logs. It doesn't work If client body size is more than several TEN KB bytes. the client body is '-' in the Nginx log.

I've added 'echo_read_request_body;' in the location to avoid an empty $request_body because Nginx may save client body to a temp file; I've configured following in my Nginx.conf:

client_max_body_size 1024M; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65;

azuryyu avatar Mar 31 '17 06:03 azuryyu

@azuryyu The standard $request_body variable of the nginx core won't read large request bodies buffered on the disk (by the nginx core).

See https://github.com/openresty/echo-nginx-module#echo_request_body

agentzh avatar Apr 01 '17 18:04 agentzh

@azuryyu For meaningful values in $request_body, you should configure client_body_buffer_size as well. It's more about the nginx core's $request_body behavior. I'm tired of educating people on standard nginx behaviors. alas.

agentzh avatar Apr 01 '17 18:04 agentzh

I've configured client_body_buffer_size = 10m before I submitted this issue.

azuryyu avatar Apr 05 '17 09:04 azuryyu