# Nginx\_limit\_access\_module - support to deny request by specific variable

**URL:** <https://www.ruby-forum.com/t/nginx-limit-access-module-support-to-deny-request-by-specific-variable/199778>\
**Category:** NGINX\
**Created:** [November 29, 2010, 9:22am UTC](https://www.ruby-forum.com/t/nginx-limit-access-module-support-to-deny-request-by-specific-variable/199778 "2010-11-29T09:22:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 29, 2010, 9:22am UTC](https://www.ruby-forum.com/t/nginx-limit-access-module-support-to-deny-request-by-specific-variable/199778/1 "2010-11-29T09:22:08Z")

</div>

Hi folks,

I develop a module which can deny request by specific variable. The  
module’s URL is: [GitHub - yaoweibin/nginx\_limit\_access\_module: support to deny specific variable with HTTP POST interface](https://github.com/yaoweibin/nginx_limit_access_module)

A simple deny ip example:  
http {

```
    limit_access_zone zone=one:5m bucket_number=10007 type=ip;

    server {
        listen 80;
        server_name localhost;

        limit_access_variable zone=one $limit_access_deny;

        location / {
            root html;
            index index.html index.htm;

            if ($limit_access_deny) {
                return 403;
            }
        }

        location /limit_interface {
            allow 192.168.1.0/24;
            deny all;
            limit_access_interface zone=one;
        }
    }
}

```

The request method sent to the interface location is POST, and the  
content-type is application/x-www-form-urlencoded. The content is like  
this:

```
ban_type=ip&ban_expire=3600&ban_list=192.168.1.1,192.168.1.2

```

And then the requests from 192.168.1.1 and 192.168.1.2 are banned in  
3600 seconds.

–  
Weibin Y.
