Welcome! Log In Create A New Profile

Advanced

How to convert an IP into a path and filename (perl within nginx)

Posted by UL 
UL
How to convert an IP into a path and filename (perl within nginx)
September 04, 2010 11:11AM
Hi,

I made a script which builds a list of banned IP and I would like to know if there is a way that nginx uses this list directly?

When the IP "AAA.BBB.CCC.DDD" is banned, the following file is created: "/some/folder/AAA/BBB/CCC/DDD.txt".

So I was thinking to use the Perl embeded engine in nginx to convert the IP into such path and test if the file exists. However, I am really not an expert in Perl at all and I don't know how to do it. Or may be it can be done by nginx itself?

Any help would be welcomed,

Thank you.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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