Open Webuser6666 opened 4 years ago
What do you mean auto switch you have to elaborate and give more detail to what it is you are asking.
My guess is that you want a feature request of the script to automatically detect when under DDoS and switch on / off right ?
My guess is that you want a feature request of the script to automatically detect when under DDoS and switch on / off right ?
yes ;)
I can do it easily would require a nginx server config tweak for users though.
http {
lua_shared_dict antiddos 10m; #Anti-DDoS shared memory zone
}
I will build it in disabled by default and people can add it to their setup and enable it if they want.
I can do it easily would require a nginx server config tweak for users though.
can add with a choice for people
The question is how to detect when under ddos.
I had some things in mind: 1.) check avg. upstream response times and enable if avg response time is above threshold 2.) check avg. requests per IP for content-type html - at east in all cases i know just checking the requests / s is not useful as a lot of sites do a lot of stuff with json, css and so and i saw very high but valid requests
Those are good methods i was also planning on using ngx.var.binary_remote_addr
and inserting their binary IP's into the shared memory space the same as limit_conn and limit_req modules do in order to save memory space since binary data is smaller than the ngx.var.remote_addr
string itself. I will add it as a feature with allot of sub features to make it easy to customise the domains, urls, paths, requests types etc you can throttle with it.
Hi. Short question - how to exclude some location for script?
@rx-209 You want to exclude a domain or a URL path like /test/lol
?
@rx-209 You want to exclude a domain or a URL path like
/test/lol
?
path like /test/lol
@rx-209
https://github.com/C0nw0nk/Nginx-Lua-Anti-DDoS/commit/bf420a3e95144ed7022209295005b6b373051828
That will allow you to set custom paths in the script to enable protection on and disable protection on.
local master_switch_custom_hosts = {
{
1, --run auth checks
"localhost/path1.*",
},
{
2, --bypass auth checks
"localhost/path2.*",
},
}
@Webuser6666 @disaster123
Currently building it at the moment may take a few weeks for me to finish.
Has anyone been able to add this function or has a solution?
I can do it easily would require a nginx server config tweak for users though.
http { lua_shared_dict antiddos 10m; #Anti-DDoS shared memory zone }
I will build it in disabled by default and people can add it to their setup and enable it if they want.
I didn't find a place to use this parameter in the documentation. Turning it on or off doesn't seem to affect the running of the script?
add Auto Switch ?