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 allow disabling of my credits as much as credit to be recieved is nice i do understand and realise people do not want to display them on their sites hence why i made it a feature to allow you to remove them easily and swiftly. :)
This commit is contained in:
@ -218,6 +218,16 @@ This way you don't have to remove access_by_lua_file anti_ddos_challenge.lua; to
|
|||||||
]]
|
]]
|
||||||
local master_switch = 1 --enabled by default
|
local master_switch = 1 --enabled by default
|
||||||
|
|
||||||
|
--[[
|
||||||
|
Enable/disable credits It would be nice if you would show these to help the community grow and make the internet safer for everyone
|
||||||
|
but if not I completely understand hence why I made it a option to remove them for you.
|
||||||
|
|
||||||
|
1 = enabled
|
||||||
|
2 = disabled
|
||||||
|
]]
|
||||||
|
local credits = 1 --enabled by default
|
||||||
|
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
End Configuration
|
End Configuration
|
||||||
|
|
||||||
@ -542,7 +552,7 @@ grant_access() --perform checks to see if user can access the site or if they wi
|
|||||||
Build HTML Template
|
Build HTML Template
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local title = host .. [[ | Anti-DDoS Flood Protection and Firewall by Conor McKnight]]
|
local title = host .. [[ | Anti-DDoS Flood Protection and Firewall]]
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
Javascript after setting cookie run xmlhttp GET request
|
Javascript after setting cookie run xmlhttp GET request
|
||||||
@ -674,6 +684,10 @@ local ddos_credits = [[
|
|||||||
</div>
|
</div>
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
if credits == 2 then
|
||||||
|
ddos_credits = "" --make empty string
|
||||||
|
end
|
||||||
|
|
||||||
local request_details = [[
|
local request_details = [[
|
||||||
<br>
|
<br>
|
||||||
<div id="status" style="color:#bd2426;font-size:200%;">
|
<div id="status" style="color:#bd2426;font-size:200%;">
|
||||||
@ -765,7 +779,9 @@ ngx.header["X-XSS-Protection"] = "1; mode=block"
|
|||||||
ngx.header["Cache-Control"] = "public, max-age=0 no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
|
ngx.header["Cache-Control"] = "public, max-age=0 no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
|
||||||
ngx.header["Pragma"] = "no-cache"
|
ngx.header["Pragma"] = "no-cache"
|
||||||
ngx.header["Expires"] = "0"
|
ngx.header["Expires"] = "0"
|
||||||
|
if credits == 1 then
|
||||||
ngx.header["X-Anti-DDoS"] = "Conor McKnight | facebook.com/C0nw0nk"
|
ngx.header["X-Anti-DDoS"] = "Conor McKnight | facebook.com/C0nw0nk"
|
||||||
|
end
|
||||||
ngx.header.content_type = "text/html; charset=" .. default_charset
|
ngx.header.content_type = "text/html; charset=" .. default_charset
|
||||||
ngx.status = expected_header_status
|
ngx.status = expected_header_status
|
||||||
ngx.say(anti_ddos_html_output)
|
ngx.say(anti_ddos_html_output)
|
||||||
|
Reference in New Issue
Block a user