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

Valentin V. Bartenev vbart at nginx.com
Wed May 11 13:49:50 UTC 2016


On Wednesday 11 May 2016 09:19:58 meteor8488 wrote:
> Hi all, I just updated my configuration files as following	
> 
> 	location ~ \.php$ {
> 			try_files $uri =404;
> 			if ($arg_mod = "upload" ) {
> 							return                 485;
> 							break;
> 						}
> 			if ($request_method = POST){
> 				return                 484;
> 				break;
> 						}
> 			error_page               484 = @post;
> 			error_page               485 = @flash;
> 			fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
> 			include        fastcgi_params;
> 			fastcgi_pass   backend;
> 		}
> 					location @post{
> 			internal;
> 			access_log /web/log/post.log  plog;
> 			try_files $uri =404;
> 			fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
> 			include        fastcgi_params;
> 			fastcgi_pass   backend;
> 			}
> 		location @flash{
> 			internal;
> 			access_log /web/log/flash.log  main;
> 			try_files $uri =404;
> 			fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
> 			include        fastcgi_params;
> 			fastcgi_pass   backend;
> 			}
> 
> 
> I'm using if to check whether user want to upload a file or not.
> 
> But I know that if is evil, so how can achieve the same result without using
> if?
> 
[..]

Please, check the "if=" parameter of the "access_log" directive.
See the docs: http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log

  wbr, Valentin V. Bartenev



More information about the nginx mailing list