mirror of
https://github.com/C0nw0nk/Nginx-Lua-Anti-DDoS.git
synced 2023-12-14 04:31:21 +00:00
Update anti_ddos_challenge.lua
Add feature to automatically detect if website we are serving traffic for is a Tor network website via the .onion domain extension and switch our compatibility to accomadate for Tor clients.
This commit is contained in:
@ -285,6 +285,10 @@ if ip_blacklist_remote_addr == "auto" then
|
||||
ip_blacklist_remote_addr = ngx.var.remote_addr
|
||||
end
|
||||
end
|
||||
--if host of site is a tor website connecting clients will be tor network clients
|
||||
if string.match(string.lower(ngx.var.host), ".onion") then
|
||||
remote_addr = "tor"
|
||||
end
|
||||
if remote_addr == "tor" then
|
||||
remote_addr = ngx.var.http_user_agent
|
||||
end
|
||||
|
Reference in New Issue
Block a user