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
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx