Proxy module for nginx

Hi, allI want to make a module for my nginx server, which can block some ip with particular features.My idea is to create a module like the proxy module in some way, can any of you give me some suggestions?Thanks a lot...