https://github.com/dutchcoders/hodor
hodor: nginx web application firewall
https://github.com/dutchcoders/hodor
Last synced: over 1 year ago
JSON representation
hodor: nginx web application firewall
- Host: GitHub
- URL: https://github.com/dutchcoders/hodor
- Owner: dutchcoders
- Created: 2015-05-05T08:26:37.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-02-08T22:30:11.000Z (over 9 years ago)
- Last Synced: 2023-08-03T21:05:37.687Z (almost 3 years ago)
- Language: Lua
- Homepage:
- Size: 1.95 KB
- Stars: 14
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hodor: nginx proxy filtering
Hodor is a library allowing you to filter on host, uri or content-type.
## Todo
* implement geo blocking
* implement antivirus / clamav
* implement dnsbl lists
* implement client ip specific blocking
* seperate configuration from logic
* define complex rules
## Implementation
Update the nginx.conf
```
lua_shared_dict my_locks 100k;
lua_package_path "lua/?.lua;../lua-resty-core/lib/?.lua;;";
resolver 8.8.8.8;
init_by_lua '
';
server {
listen 0.0.0.0:80;
server_name _;
header_filter_by_lua_file 'header_filter.lua';
access_by_lua_file 'access.lua';
location / {
proxy_ssl_verify off;
proxy_pass_header Server;
proxy_set_header Host $host;
proxy_pass http://$host:80;
}
}
```
Reloading the rules
```
kill -HUP $( cat /usr/local/openresty/nginx/logs/nginx.pid )
```
## Contributions
Contributions are welcome.
## Creators
**Remco Verhoef**
-
-
## Copyright and license
Code and documentation copyright 2011-2015 Remco Verhoef.
Code released under [the MIT license](LICENSE).