# ngx_waf
**Repository Path**: stepwen2/ngx_waf
## Basic Information
- **Project Name**: ngx_waf
- **Description**: No description available
- **Primary Language**: C
- **License**: BSD-3-Clause
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-05-07
- **Last Updated**: 2021-05-12
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# ngx_waf
[](https://github.com/ADD-SP/ngx_waf/actions?query=workflow%3Atest)
[](https://docs.addesp.com/ngx_waf/zh-cn/)
[](https://github.com/ADD-SP/ngx_waf/actions/workflows/docker.yml)
[](https://www.codacy.com/gh/ADD-SP/ngx_waf/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ADD-SP/ngx_waf&utm_campaign=Badge_Grade)
[](https://github.com/ADD-SP/ngx_waf/releases)
[](https://semver.org/lang/zh-CN/)
[](https://t.me/ngx_waf)
[](https://t.me/ngx_waf_group)
[English](README.md) | 简体中文
方便且高性能的 Nginx 防火墙模块。
## 为什么选择 ngx_waf
* 功能齐全:「网络应用防火墙」的基本功能都有。
* 安装方便:
* 仅依赖 `uthash` 库,并且可以直接通过包管理器(如 apt)安装。
* 无需提前安装其它模块。
* 使用方便:配置指令简单易懂,不用看文档都能猜到大概是什么意思。
* 高性能:经过较为极限的测试,启动本模块后 RPS(每秒请求数) 降低约 4%。测试说明和结果见使用文档。
## 功能
* SQL 注入检测。
* 支持 IPV4 和 IPV6。
* CC 防御,超出限制后自动拉黑对应 IP 一段时间。
* IP 黑白名单,同时支持类似 `192.168.0.0/16` 和 `fe80::/10`,即支持点分十进制和冒号十六进制表示法和网段划分。
* POST 黑名单。
* URL 黑白名单
* 查询字符串(Query String)黑名单。
* UserAgent 黑名单。
* Cookie 黑名单。
* Referer 黑白名单。
## 使用文档
* 推荐链接:[https://docs.addesp.com/ngx_waf/zh-cn/](https://docs.addesp.com/ngx_waf/zh-cn/)
* 备用链接 1:[https://add-sp.github.io/ngx_waf/zh-cn/](https://add-sp.github.io/ngx_waf/zh-cn/)
* 备用链接 2:[https://ngx-waf.pages.dev/zh-cn/](https://ngx-waf.pages.dev/zh-cn/)
## 联系方式
* Telegram 频道: [https://t.me/ngx_waf](https://t.me/ngx_waf)
* Telegram 群组: [https://t.me/ngx_waf_group](https://t.me/ngx_waf_group)
## 开源许可证
[BSD 3-Clause License](LICENSE)
## 感谢
* [uthash](https://github.com/troydhanson/uthash): 本项目使用 uthash 的一些数据结构。
* [libinjection](https://github.com/client9/libinjection): 本模块使用此项目检测 SQL 注入。
* [ngx_lua_waf](https://github.com/loveshell/ngx_lua_waf): 本模块的默认规则大多来自于此。
* [nginx-book](https://github.com/taobao/nginx-book): 感谢作者提供的教程。
* [nginx-development-guide](https://github.com/baishancloud/nginx-development-guide): 感谢作者提供的教程。