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
Fix output for remote_addr on Authentication page in HTML, If you change the variable `local remote_addr =` in your settings / setup / config at the start of the script the output on the auth page where it should say `IP Address` would be what you set the `remote_addr` as so to fix it and ensure it stays as an IP Address not User-Agent etc I manualy set it back with logical operators.
This commit is contained in:
@ -688,6 +688,15 @@ if credits == 2 then
|
||||
ddos_credits = "" --make empty string
|
||||
end
|
||||
|
||||
--Fix remote_addr output as what ever IP address the Client is using
|
||||
if ngx.var.http_cf_connecting_ip ~= nil then
|
||||
remote_addr = ngx.var.http_cf_connecting_ip
|
||||
elseif ngx.var.http_x_forwarded_for ~= nil then
|
||||
remote_addr = ngx.var.http_x_forwarded_for
|
||||
else
|
||||
remote_addr = ngx.var.remote_addr
|
||||
end
|
||||
|
||||
local request_details = [[
|
||||
<br>
|
||||
<div id="status" style="color:#bd2426;font-size:200%;">
|
||||
|
Reference in New Issue
Block a user