{"id":13394525,"url":"https://github.com/alexazhou/VeryNginx","last_synced_at":"2025-03-13T20:31:34.756Z","repository":{"id":45700582,"uuid":"48843327","full_name":"alexazhou/VeryNginx","owner":"alexazhou","description":" A very powerful and friendly  nginx base on lua-nginx-module( openresty ) which provide WAF, Control Panel, and Dashboards. ","archived":false,"fork":false,"pushed_at":"2020-06-30T07:07:17.000Z","size":642,"stargazers_count":5954,"open_issues_count":113,"forks_count":957,"subscribers_count":270,"default_branch":"master","last_synced_at":"2024-07-31T17:22:31.683Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexazhou.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-31T09:11:43.000Z","updated_at":"2024-07-31T17:17:55.000Z","dependencies_parsed_at":"2022-07-19T18:04:14.156Z","dependency_job_id":null,"html_url":"https://github.com/alexazhou/VeryNginx","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexazhou%2FVeryNginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexazhou%2FVeryNginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexazhou%2FVeryNginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexazhou%2FVeryNginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexazhou","download_url":"https://codeload.github.com/alexazhou/VeryNginx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243478137,"owners_count":20297198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T17:01:22.618Z","updated_at":"2025-03-13T20:31:34.171Z","avatar_url":"https://github.com/alexazhou.png","language":"Lua","readme":"# VeryNginx\nVeryNginx is a very powerful and friendly nginx .\n\n[中文文档](https://github.com/alexazhou/VeryNginx/blob/master/readme_zh.md)\n\n### Notice\nAfter v0.2 , The entry uri of control panel was moved to `/verynginx/index.html`\n\n\n## Description\n\nVeryNginx 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.\n\n[VeryNginx online demo](http://alexazhou.xyz/vn/index.html) \n\nUser / Password: **verynginx / verynginx**\n\nThe full version of config guide can be found on: [VeryNginx Wiki](https://github.com/alexazhou/VeryNginx/wiki) .\n\n### Nginx run status analyzing\n\n* Request per second\n* Response time\n* Net Traffic\n* Tcp connectinn num\n\n![Nginx status](http://ww2.sinaimg.cn/mw690/3fcd0ed3jw1f17en7oc1yj20z00ol0wl.jpg)\n\n\n### Custom Action\n\nVeryNginx supports custom actions, which can do a lot of things.\n\nCustom 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.\n\n\u003eThe 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.\n\n#### Matcher\n\nA `Matcher` is used to select a part of all requests, a `Matcher` may contain one or more condition. The following conditions are currently supported:\n\n* Client IP\n* Host\n* UserAgent\n* URI\n* Referer\n* Request Args\n\nWhen a request does not conflict with any of the conditions of the Matcher, the request will be selected by the `Matcher`\n\n#### Action\n\nEvery `Action` refers to a `Matcher` , and will run on the requests selected by the `Matcher` \n\nNow we have these `Action`s\n\n* **Scheme** Lock lock the scheme to http/https\n* **Redirect** Redirect request\n* **URI Rewrite** Do internal rewrite on the request\n* **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.\n* **Frequency Limit** Limit max request time in a specified time period\n* **Filter** Block some request, can do the WAF\n\nMatcher 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.\n\nVeryNginx presets some simple filter rules, which can prevent simple SQL injection, Git and SVN file disclosure, directory traversal attacks and common scanning tool.\n\n![VeryNginx Matcher](http://ww2.sinaimg.cn/mw690/3fcd0ed3jw1f17en8ovthj20zs0pdn1x.jpg)\n\n![VeryNginx filter](http://ww3.sinaimg.cn/mw690/3fcd0ed3jw1f17en9lrarj20zw0piq77.jpg)\n\n#### Backend\n\nEvery `Backend` refers to a `Matcher`，and will handle the requests selected by the `Matcher`\n\nNow we have these `Backend`\n\n* **Proxy Pass** Proxy the request to other server\n* **Static File** Use local file to handle the request file \n\n### Request statistics\n\nVeryNginx can record the request of URI, include these data of every URI:\n\n* All Request Count\n* Request count of every status code\n* Total Bytes \n* Avg Bytes\n* Total response time\n* Avg reqponse time\n\n\n![request statistics](http://ww1.sinaimg.cn/mw690/3fcd0ed3jw1f17ena2ipyj20zw0piqag.jpg)\n\n\n## Installation\n\n### Install Nginx / OpenResty\n\nVeryNginx is based on OpenResty, so you need to install it first. But don't warry, VeryNginx gives a script to do it automatically.\n\n\n```\npython install.py install\n```\n\nJust run this command, openresty and verynginx will be installed automatically.\n \n#### Want using custom nginx?\n\nVeryNginx can install openresty automatically so that you **needn't install nginx(openresty) manually**.\n\nBut if you want use a nginx compiled by you self, that also ok. You can see that for some help \n\n[Use-own-nginx](https://github.com/alexazhou/VeryNginx/wiki/Use-own-nginx)\n\n### Usage\n\n#### Edit nginx configuration file\n\nThe configuration file of VeryNginx is `/opt/verynginx/openresty/nginx/conf/nginx.conf`, that's a demo. It just can let verynginx run so that you can see the dashboard of verynginx. If you want do something really useful, you need edit that file and add your own nginx configuration into it.\n\n\u003e\nThis configuration file add three `include` command to embeded verynginx into original nginx( openresty ) \n\n\u003e\n* include /opt/verynginx/verynginx/nginx_conf/in_external.conf;\n* include /opt/verynginx/verynginx/nginx_conf/in_http_block.conf;\n* include /opt/verynginx/verynginx/nginx_conf/in_server_block.conf;\n\n\u003eThese `include` command were placed outside a block, block http internal configuration, server configuration block inside, Remenber keep these three line when modifying. If you add a new Server configuration block or http configuration block, also need add suitable `include` line into it.\n\n### Start / Stop / Restart Service\n\n```\n#Start Service\n/opt/verynginx/openresty/nginx/sbin/nginx\n\n#Stop Service\n/opt/verynginx/openresty/nginx/sbin/nginx -s stop\n\n#Restart Service\n/opt/verynginx/openresty/nginx/sbin/nginx -s reload\n\n```\n\n### Configure VeryNginx on dashboard\n\nAfter the service begin running, you can see server status and do config on dashboard.\n\nThe address  of dashboard is `http://{{your_machine_address}}/verynginx/index.html`.\n\nDefault user and password is `verynginx` / `verynginx`. You should be able to work through all the options now.\n\nThe full version of config guide can be found in [VeryNginx Wiki](https://github.com/alexazhou/VeryNginx/) .\n\n### Trouble Shooting\n\nIf you have any problems during **installation** / **configuration** / **use** , you can refer the Trouble Shooting document.\n\n[Trouble Shooting](https://github.com/alexazhou/VeryNginx/wiki/Trouble-Shooting) \n\n#### Tips\n\n* New configs will be effective immediately upon saving. It's not necessary to restart or reload nginx.\n\n* When you save config, VeryNginx will write all configs to `/opt/verynginx/verynginx/configs/config.json`.\n\n* If the chat in status page is stuck, you can click the gear icon in the upper right corner to turn off animation\n\n* If you lock yourself out of VeryNginx by doing something stupid, you can always delete `config.json` to revert VeryNginx to its default.\n\n### Update VeryNginx / OpenResty\n\nOver time, VeryNginx own will evolve, and can also support newer version of OpenResty. New version of VeryNginx might support some new features or fix some old bugs. If you want to update locally installed VeryNginx, you just need pull the latest code from github to local, and run the following commands:\n\n```\n#Update VeryNginx\npython install.py update verynginx\n\n#Update OpenResty\npython install.py update openresty\n\n```\n\ninstall.py will keep the old config.json and nginx.conf during update. So that you **will not lost configuration** after update.\n\n### Build VeryNginx docker Image\n\nAfter cloning code to your local filesystem, you can run the following commands:\n\n```\ndocker build -t verynginx .\ndocker run verynginx\n```\n\nThen you can navigate to your browser `http://{{your_docker_machine_address}}/verynginx/index.html`\n\nOptionally you can run `docker run -p xxxx:80 verynginx` to map your container port 80 to your host's xxxx port\n\n\n## Donate\n\nIf you like VeryNginx, you can donate to support my development VeryNginx. With your support, I will be able to make VeryNginx better 😎.\n\n### PayPal \n\n[Support VeryNginx via PayPal](https://www.paypal.me/alexazhou)\n\n### We Chat\n\nScan the QRcode to support VeryNginx.\n\n\u003cimg title=\"WeChat QRcode\" src=\"http://ww4.sinaimg.cn/mw690/3fcd0ed3jw1f6kecm1e3nj20f00emq59.jpg\" width=\"200\"\u003e\n\n## Thanks\n\n[VeryNginx thanks for the help](https://github.com/alexazhou/VeryNginx/wiki/Thanks)\n\n\n### Enjoy~\n\n[^openresty]: [OpenResty](https://github.com/openresty/openresty) Openresty is a enhanced nginx，bundle standard nginx core and lots of 3rd-party nginx module. \n\n","funding_links":["https://www.paypal.me/alexazhou"],"categories":["Lua","HTML","Lua (24)","Tools","Resources","OpenResty"],"sub_categories":["Lua Modules","Web Plataforms"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexazhou%2FVeryNginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexazhou%2FVeryNginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexazhou%2FVeryNginx/lists"}