change client_body_buffer_size from 16K to 256K made the nginx logs size from 50M to 1G..

Francis Daly francis at daoine.org
Wed May 11 07:36:21 UTC 2016


On Wed, May 11, 2016 at 01:39:14AM -0400, meteor8488 wrote:

> 	log_format  plog  '$remote_addr - $remote_user [$time_local] "$request" '
> 	'$status $body_bytes_sent "$http_referer" '
> 	'"$http_user_agent" "$http_x_forwarded_for" "$request_body"';

What do you think that the last element of that log_format definition does?

http://nginx.org/r/$request_body

> Is that because I changed client_body_buffer_size  from 16K to 256K caused
> the size change of the log file?
> For now the client_body_buffer_size is big enough, when users upload a file,
> then nginx will put it into the buffer instead of a temp file, and then also
> write this file into post.log?  Am I right? 

Yes.

> If I'm right, then how can I exclude file upload from the post log? The
> $request_uri for the upload is mod=swfupload.

If you don't want the request body logged, don't log the request body.

If you don't want the request body logged for one $request_uri only,
you can finish handling that in a specific location{} and use a different
access_log there.

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list