I'm using a map configuration to block IP addresses with nginx + fail2ban
The sample configuration genrator code in fail2ban repo looks like this :
...
_echo_blck_row = printf '\%%s 1;\n' "<fid>"
actionban = %(_echo_blck_row)s >> '%(blck_lst_file)s'; %(blck_lst_reload)s
...
Note the leading backslash in \%%s 1;\n
. It creates a file with IP addresses that have a leading backslash before each IP address i.e. it dumps a file like this
\127.0.0.1 1;
instead of simply
127.0.0.1 1;
Both the configurations are correct. What's the purpose of the backslash at the start of the IP address in this file ?