A
A
Alex2020-01-02 22:40:42
Nginx
Alex, 2020-01-02 22:40:42

Nginx: is it possible to block spam requests?

Entries like this often appear in access.log:

X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36"
111.229.118.166 - - [02/Jan/2020:18:46:56 +0300] "GET /phpMyAdmin4.8.1/index.php HTTP/1.1" 404 580 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36"
111.229.118.166 - - [02/Jan/2020:18:46:56 +0300] "GET /phpMyAdmin4.8.2/index.php HTTP/1.1" 404 580 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36"
111.229.118.166 - - [02/Jan/2020:18:46:58 +0300] "GET /phpMyAdmin4.8.3/index.php HTTP/1.1" 404 580 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36"
111.229.118.166 - - [02/Jan/2020:18:46:58 +0300] "GET /phpMyAdmin4.8.4/index.php HTTP/1.1" 404 580 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36"
111.229.118.166 - - [02/Jan/2020:18:46:28 +0300] "GET /joomla/ HTTP/1.1" 404 580 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0)"
111.229.118.166 - - [02/Jan/2020:18:46:30 +0300] "POST /%75%73%65%72%2e%70%68%70 HTTP/1.1" 404 580 "554fcae493e564ee0dc75bdf2ebf94caads|a:3:{s:2:\x22id\x22;s:3:\x22'/*\x22;s:3:\x22num\x22;s:141:\x22*/ union select 1,0x272F2A,3,4,5,6,7,8,0x7b247b24524345275d3b6469652f2a2a2f286d6435284449524543544f52595f534550415241544f5229293b2f2f7d7d,0--\x22;s:4:\x22name\x22;s:3:\x22ads\x22;}554fcae493e564ee0dc75bdf2ebf94ca" "Mozilla/5.0 (Windows NT 6.1; Win64; x64)

Is it possible to send a ban for several hours using Nginx, so that Nginx does not once again mutuz with such requests? Or does it make no sense?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2020-01-02
@Nc_Soft

nginx.com/blog/rate-limiting-nginx/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question