Welcome! Log In Create A New Profile

Advanced

Re: How many args in $args?

Valentin V. Bartenev
March 07, 2012 05:32AM
On Wednesday 07 March 2012 14:09:38 John Moore wrote:
> Is there some means of determining how many query parameters are being
> passed, by looking $args, say? There's a kind of DOS attack which can
> bring down Java based webapps which do binding of request parameters to
> properties, and it seems to me that nginx used as a remote proxy server
> could probably prevent this simply by rejecting requests which had more
> than x query parameters.

You can simple utilize regexp functionality for such task, i.e.:

if ($args ~ "^(?:[^&]+&){16}") {
return 403;
}

http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if

wbr, Valentin V. Bartenev

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How many args in $args?

J2R March 07, 2012 05:10AM

Re: How many args in $args?

Maxim Dounin March 07, 2012 05:26AM

Re: How many args in $args?

Valentin V. Bartenev March 07, 2012 05:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 207
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready