Git Product home page Git Product logo

ngx_web_blacklist's Introduction

ngx_web_blacklist

nginx web 在线增加 黑名单, 阻止访问

这是一个非常简单的应用基于 ngx_lua,代码也非常简单

主要实现

提供接口 动态增加 黑名单

web 在线 查看 增加 删除黑名单

目前这里这要通过 elk,获取ip ,邮件通知后,web上确定后,才增加阻挡ip 访问

流程

ngx_web

配置安装

  1. nginx 安装 lua 扩展 或使用 openresty ,需要 resty.template

  2. 将目录拷呗至 nginx conf 目录

  3. nginx.conf 增加 access_by_lua_file "conf/lua/access_limit.lua";

  4. lua_shared_dict shared_ip 5m;

  5. lua_shared_dict shared_blacklist_ip 5m;

  6. 增加1个 location 名字随意

location /black {

​ default_type 'text/html';

​ content_by_lua_file "conf/lua/black.lua";

}

set $template_location "/templates";

set $template_root "conf/templates";

location /templates {

internal;

}

界面截图

增加

通过接口把ip 增加至 可增加ip列表 ,确认后 点 添加至阻挡列表 ,真正开始阻挡ip 访问

add

test

测试增加本机ip后,刷新 即出现 403拒绝访问

ngx_web_blacklist's People

Contributors

llych avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.