Nginx-Lua-Anti-DDoS icon indicating copy to clipboard operation
Nginx-Lua-Anti-DDoS copied to clipboard

ip blacklist not working

Open rosolinol opened this issue 5 years ago • 3 comments

tried to ban myself as

local ip_blacklist = {
"xx.99.0.0/18",
}

logs

2020/05/16 17:37:03 [warn] 1244#1244: *11 [lua] _G write guard:12: __newindex(): writing a global lua variable ('shuffle') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables
stack traceback:
        /etc/nginx/anti_ddos_challenge.lua:2454: in main chunk, client: xx.99.118.30, server: example.com, request: "GET /index.php HTTP/2.0", host: "example.com"

the same things stands for ip_whitelist doesn't work also some other user reported https://github.com/C0nw0nk/Nginx-Lua-Anti-DDoS/issues/44

also i have another question can you provide a more friendly log output or allowing user to somewhat log "functions" or create custom log formats something similar to nginx ?

log_format raw 'FROM: $remote_addr  | STATUS: $status | TO: $request | CACHE: $upstream_cache_status';

?!

Thank you.

rosolinol avatar May 16 '20 17:05 rosolinol

Simply restart your webserver. It needs to reload script.

Sylvvvia avatar May 20 '20 07:05 Sylvvvia

@Sylvvvia please stop telling ppl to restart nginx it makes no sense at all. ppl who had the knowledge to install lua and this module they also know that restart is required after changes.

In my case was wrong ipv4 passed to nginx since it was behind NAT. After this fix it has been working well so far.

Still requesting help for custom logs so i'm not closing this without e reply from dev.

rosolinol avatar May 29 '20 13:05 rosolinol

Fix here https://github.com/bis-gmbh/Nginx-Lua-Anti-DDoS/commit/80f23fd677cea630cafb142039f681fec85f08da

glushchenko avatar Feb 24 '23 19:02 glushchenko