Server hardening without "If" conditions

Edho P Arief edhoprima at gmail.com
Wed Jun 1 17:02:57 MSD 2011


On Wed, Jun 1, 2011 at 7:47 PM, pk899 <nginx-forum at nginx.us> wrote:
> Hi. I notice that nginx with just the location rules and usual
> directives results in mind-blowing performance. Apache Bench test shows
> "115,000 requests per second" can be handled.
>
> However, when I add a simple rule:
>
>    if ($request_method !~ ^(GET|HEAD|POST)$ ) {
>      return 444;
>    }
>
> Which I think is important from a point of view of getting rid of so
> much junk that hits any modern server, the requests per second fall to
> "1,200" !!!
>

I'm interested in what way this is important. Especially since nginx
will just return error 400 on bad requests.



More information about the nginx mailing list