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

IP whitelist for ranges doesn't works

Open momkin opened this issue 5 years ago • 7 comments

Issue title

The IP ranges i allowed bellow doesn't get whitelisted by the script ! I've tried to many times but still not working !

Issue Description

Versions:

  • Browser(s):
  • Nginx version:
  • Operating system of web server running Nginx:

Nginx config:

local ip_whitelist = {
"66.102.0.0/20","66.102.0.0/24","66.102.1.0/24","66.102.2.0/24","66.102.3.0/24","66.102.4.0/24","66.102.8.0/23","66.102.12.0/24","66.249.64.0/19","66.249.64.0/20","66.249.80.0/22","66.249.84.0/23","66.249.88.0/24",
}

Screenshot(s):

[Screenshot(s) for difficult to describe visual issues are mandatory. Post links instead of Inline Images for Screenshots containing Adult material.]

Settings:

  • [List here all the changes you made to the default settings]

Other optional information you want to add other than the above:

momkin avatar May 16 '20 01:05 momkin

Ip blacklist/whitelist works fine, after you have added ips into the table you need to restart webserver (no reload, but restart).

Sylvvvia avatar May 20 '20 07:05 Sylvvvia

Why would you restart vs reload?

AndreiG6 avatar May 20 '20 10:05 AndreiG6

Reload doesn't reload script it reloads only nginx config / openresty config. In my openresty reload doesn't work for script but restart re-reads it and blacklist/whitelist works as expected.

Sylvvvia avatar May 20 '20 10:05 Sylvvvia

Sounds like something is being done wrong if that's what you're getting IMO. A reload should do just that, gracefully reload the config openresty/nginx config, re-init_by_lua, etc

AndreiG6 avatar May 20 '20 11:05 AndreiG6

The

Ip blacklist/whitelist works fine, after you have added ips into the table you need to restart webserver (no reload, but restart).

If you you put to many ranges like 15 ranges of IPS it doesn't works ! If i put less ranges like 5 it works !

momkin avatar May 20 '20 16:05 momkin

Actually i have 43 ranges whitelisted to be exact :-)

Sylvvvia avatar May 20 '20 16:05 Sylvvvia

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

glushchenko avatar Feb 24 '23 19:02 glushchenko