How to avoid admin account to be blocked for all ip's by failed attemps to login? In my drupal site, often i see this message for the admin account

Sorry, too many failed login attempts from your IP address. This IP address is temporarily blocked.


I know i can solve it clearing the 'flood' database table, and i'm almost sure it is caused by people or bot trying to login as admin. 'Almost' for in the table flood the failed attemps have identifier '1-127.0.0.1' that is the local ip and it sound strange to me...
There is a way to avoid the problem for good? (and to be sure it is about people/bot trying to login and not something else?)

(I mean obviously a convenient way. Allowing all the login attemps without blocking them is not a solution.)
The answer can be found in this article

https://www.karelbemelmans.be/2015/04/reverse-proxy-configuration-for-drupal-7-sites/


Adding these lines to settings.php solves the issue:

$conf['reverse_proxy'] = TRUE;
$conf['reverse_proxy_addresses'] = array('127.0.0.1');
$conf['reverse_proxy_header'] = 'HTTP_X_FORWARDED_FOR';


Added these lines, in the flood table of the drupal site database, every failed login request is logged with the real ip the request came from.

The real problem, indeed, was not lying in the failed login attemps, but in linking all the attemps to the loopback address. Looking at the flood table in drupal database, I could see every request under the ip 127.0.0.1, which is wrong and causes any request from any user (and any ip) to be blocked if anyone from any ip tried to login with wrong passwords. Linking attemps to their right ip makes the drupal flood protection working as expected, that is blocking attemps only from the ip which tried to login with wrong password.