3

I am using NGINX as web server in my VPS, I would like to configure it to block flooding requests. I found HttpLimitReqModule module but I need to avoid send a reply to the user.

I saw the module sends back a 503 http error if the number of requests is higher that the setting. Can I block sending the replies to the user? I would just close the connection.

(I think it is much faster)

Thanks

3 Answers 3

5

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

Stops processing and returns the specified code to a client. The non-standard code 444 closes a connection without sending a response header.

http://nginx.org/en/docs/http/ngx_http_limit_req_module.html#limit_req_status

syntax: limit_req_status code;
default: limit_req_status 503;

So limit_req_status 444; can help.

3

Issue a HTTP status 444. No headers will be returned, and the connection will be closed.

"444 No Response (Nginx) Used in Nginx logs to indicate that the server has returned no information to the client and closed the connection (useful as a deterrent for malware)."

http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Server_Error

1
  • That respective Wikipedia entry, funny enough, links back to this Serverfault question. I guess we have a chicken or egg dilemma on our hands.. :)
    – vic
    Jan 2, 2016 at 13:20
1

Consider using of proper HTTP status codes for the sake of reliable web applications.

RFC 6585 Section 4 indicates that HTTP 429 - Too Many Requests header should used for rate limiting purposes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .