alexazhou /VeryNginx

A very powerful and friendly nginx base on lua-nginx-module( openresty ) which provide WAF, Control Panel, and Dashboards.

★ 5,973⑂ 936👁 263⑃ 44● 218▤ 16
LuaCreated 2015-12-31
+0
Daily
+0
Weekly
-3
Monthly
5,973
stars
936
forks
263
watchers
44
prs
218
issues
16
releases

README

VeryNginx
VeryNginx is a very powerful and friendly nginx .

中文文档

 Notice
After v0.2 , The entry uri of control panel was moved to /verynginx/index.html


 Description

VeryNginx is based on lua_nginx_module(openrestry). It implements advanced firewall(waf), access statistics and some other features. It strengthens the Nginx's functions, and provides a friendly Web interface.

VeryNginx online demo 

User / Password: verynginx / verynginx

The full version of config guide can be found on: VeryNginx Wiki .

 Nginx run status analyzing

 Request per second
 Response time
 Net Traffic
 Tcp connectinn num

!Nginx status


 Custom Action

VeryNginx supports custom actions, which can do a lot of things.

Custom action consists of two parts, Matcher and Action . Matcher is used to test whether a request meets the rule, Action is the logic you want to run.

The advantage of this design is that the Matcher includes all select rule, and can be reused, making use of rules to describe a very complex logic possible.

 Matcher

A Matcher is used to select a part of all requests, a Matcher may contain one or more condition. The following conditions are currently supported:

 Client IP
 Host
 UserAgent
 URI
 Referer
 Request Args

When a request does not conflict with any of the conditions of the Matcher, the request will be selected by the Matcher

 Action

Every Action refers to a Matcher , and will run on the requests selected by the Matcher 

Now we have these Actions

 Scheme Lock lock the scheme to http/https
 Redirect Redirect request
 URI Rewrite Do internal rewrite on the request
 Browser Verify Use set-cookies and javascript to verify the client is a browser,and block traffic of the robot. This action may block the spider of search engine, so please enable it when under attack only.
 Frequency Limit Limit max request time in a specified time period
 Filter Block some request, can do the WAF

Matcher can select requests by multiple conditions, so with Filter Action, we got a powerful waf. The waf can filter requests with complex rules and return special status code when it block a request.

VeryNginx presets some simple filter rules, which can prevent simple SQL injection, Git and SVN file disclosure, directory traversal attacks and common scanning tool.

!VeryNginx Matcher

!VeryNginx filter

 Backend

Every Backend refers to a Matcher,and will handle the requests selected by the Matcher

Now we have these Backend

 Proxy Pass Proxy the request to other server
 Static File Use local file to handle the request file 

 Request statistics

VeryNginx can record the request of URI, include these data of every URI:

 All Request Count
 Request count of every status code
 Total Bytes 
 Avg Bytes
 Total response time
 Avg reqponse time


!request statistics


 Installation

 Install Nginx / OpenResty

VeryNginx is based on OpenResty, so you need to install it first. But don't warry, VeryNginx gives a script to do it automatically.



python install.py install

Snapshot: 2026-11-04T14:00:00Z · Data license Apache-2.0 · JSON