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:
C0nw0nk
2020-01-31 21:15:55 +00:00
committed by GitHub
parent 113f1dacae
commit 22406ba15b

View File

@ -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%;">