简介
这个是基于openresty(打包有nginx的模块及nginx本身)开发出来的web防火墙,主要功能有
- 1、静态页面防cc攻击
- 2、动态页面防cc攻击(包括js跳转认证)
- 3、防止sql注入攻击
- 4、防止上传php webshell
- 5、防止xss攻击
- 6、取消特定目录php执行权限
项目地址:https://github.com/centos-bz/http-guard
安装方法
代码下载回来后,执行install.sh脚本开始安装。
使用方法
复制conf目录下的lua文件到/usr/local/nginx/conf下,在nginx.conf配置文件中的http代码段加入如下代码:
lua_shared_dict http_guard 10m; init_by_lua_file 'conf/init.lua'; header_filter_by_lua_file 'conf/send_cookie.lua'; access_by_lua_file 'conf/http_guard.lua'; |
注:
1、一些初始参数可以在init.lua文件修改
2、修改lua文件后,需要重载配置文件,如/usr/local/nginx/sbin/nginx -s reload
3、此http-guard已经包含nginx,不需要再安装新的nginx
4、nginx会安装在/usr/local/nginx位置