mitchellkrogza / nginx-ultimate-bad-bot-blocker

Nginx Block Bad Bots, Spam Referrer Blocker, Vulnerability Scanners, User-Agents, Malware, Adware, Ransomware, Malicious Sites, with anti-DDOS, Wordpress Theme Detector Blocking and Fail2Ban Jail for Repeat Offenders
Other
3.81k stars 472 forks source link

[BUG] declarative 'if' issues in the conf files #499

Closed Sharlyll closed 1 year ago

Sharlyll commented 1 year ago

Describe the bug

Hi,

I get this errors on a fresh install of nginx-ucltimate-bad-bot-blocker. Following the steps as laid out.

nginx: [warn] duplicate network "138.199.57.151", value: "0", old value: "1" in /etc/nginx/conf.d/globalblacklist.conf:18873 nginx: [warn] duplicate network "143.244.38.129", value: "0", old value: "1" in /etc/nginx/conf.d/globalblacklist.conf:18889 nginx: [warn] duplicate network "195.181.163.194", value: "0", old value: "1" in /etc/nginx/conf.d/globalblacklist.conf:18984 nginx: [warn] duplicate network "5.188.120.15", value: "0", old value: "1" in /etc/nginx/conf.d/globalblacklist.conf:19111 nginx: [warn] duplicate network "89.187.173.66", value: "0", old value: "1" in /etc/nginx/conf.d/globalblacklist.conf:19158 nginx: [emerg] "if" directive is not allowed here in /etc/nginx/bots.d/blockbots.conf:58 nginx: configuration file /etc/nginx/nginx.conf test failed

To Reproduce

Follow the steps laid out on this git repository

Expected behavior

As described here on the guide, there should be no errors.

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Copy of nginx.conf

If applicable please paste your nginx.conf file here (paste in between the markers)


Paste nginx.conf here

Copy of vhost / website / host .conf file

If applicable please paste your site/vhost configuration file in between the code ticks (paste in between the markers)


Paste site config here

Server (please complete the following information):

Post output of uname -a here


 - Nginx Version [post output of sudo nginx -v]
1.18
L8X commented 1 year ago

Bump @mitchellkrogza

leandrodiogenes commented 1 year ago

any solution?

L8X commented 1 year ago

@mitchellkrogza

mitchellkrogza commented 1 year ago

@mitchellkrogza

These are merely [warn] errors and must just be ignored they don't affect or slow down the operation of the blocker whatsoever. These warnings change frequently as new bad IP lists are populated every day.

L8X commented 1 year ago

@mitchellkrogza

These are merely [warn] errors and must just be ignored they don't affect or slow down the operation of the blocker whatsoever. These warnings change frequently as new bad IP lists are populated every day.

You're wrong, they stop nginx loading entirely, it's an EMERG error, not a WARN error. Please fix this.

mitchellkrogza commented 1 year ago

@mitchellkrogza

These are merely [warn] errors and must just be ignored they don't affect or slow down the operation of the blocker whatsoever. These warnings change frequently as new bad IP lists are populated every day.

You're wrong, they stop nginx loading entirely, it's an EMERG error, not a WARN error. Please fix this.

Sorry never saw your last line. This means you have your two blocker includes in the wrong place it's that simple. They must be within a server {} block and you will only get this error when they are not so there is nothing to fix except where you have inserted the includes.