Welcome! Log In Create A New Profile

Advanced

nginx limit_req and limit_conn not working to prevent DoS attack

August 01, 2017 09:29PM
Hi All,

I am using nginx in our products. When I run goldeneye DoS attack script against nginx, it is not able to defend against the attack and normal users getting impacted.

python goldeneye.py http://<ipaddress> -w 5 -s 10000 -m random -d

we are using below nginx limit_req options but didnt help. The nginx documentation says that, these options are used to limit the request rating limit per key. below is some sample configuration that we tried. The problem is, when we use these nginx options, it still keeps nginx busy responding with 503 or some other error code for all those requests beyond the rate limit . Hence any genuine user when trying to access webserver during the attack time, not getting chance to access our server and timing out or getting 500 error.

http {
limit_req_zone $binary_remote_addr zone=one:10m rate=5r/s;

...

server {

limit_req zone=one ;
...

location /sampleurl/ {

}

(Note: also tried limit_conn options and behavior is same).



Why should nginx respond back with any error code rather it should drop connections !! otherwise it can't protect itself against any DoS attack.
please share the thoughts.
Subject Author Posted

nginx limit_req and limit_conn not working to prevent DoS attack

Phani Sreenivasa Prasad August 01, 2017 09:29PM

Re: nginx limit_req and limit_conn not working to prevent DoS attack

tokers August 01, 2017 09:48PM

Re: nginx limit_req and limit_conn not working to prevent DoS attack

Phani Sreenivasa Prasad August 01, 2017 10:13PM

Re: nginx limit_req and limit_conn not working to prevent DoS attack

Anoop Alias August 01, 2017 11:28PM

Re: nginx limit_req and limit_conn not working to prevent DoS attack

Phani Sreenivasa Prasad August 02, 2017 12:08AM

Re: nginx limit_req and limit_conn not working to prevent DoS attack

gariac August 02, 2017 12:00AM

Re: nginx limit_req and limit_conn not working to prevent DoS attack

gariac August 02, 2017 12:28AM

Re: nginx limit_req and limit_conn not working to prevent DoS attack

B.R. via nginx August 02, 2017 04:18AM

Re: nginx limit_req and limit_conn not working to prevent DoS attack

Valery Kholodkov August 02, 2017 08:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 294
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