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:
C0nw0nk
2020-02-02 18:55:54 +00:00
committed by GitHub
parent 515a5d9be7
commit 6087320fd7

View File

@ -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