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.82k stars 472 forks source link

[BUG] nginx: [emerg] "if" directive is not allowed here in /etc/nginx/bots.d/blockbots.conf:58 #404

Closed aguiteras closed 3 years ago

aguiteras commented 3 years ago

Describe the bug

Installed the application. Setup run. No configs changed. Added: include /etc/nginx/bots.d include /etc/nginx/conf.d at the top of nginx config file.

Error shown restarting nginx:

nginx: [emerg] "if" directive is not allowed here in /etc/nginx/bots.d/blockbots.conf:58

Nginx version: nginx -v nginx version: nginx/1.10.3

To Reproduce

Same as bug reporting.

Expected behavior

Nginx restarted without errors .

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

```3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux

 - Nginx Version [post output of sudo nginx -v]

```nginx version: nginx/1.10.3

Paste output of `sudo nginx -V` here (paste in between the ```     ``` markers)

Paste any log / error messages here (paste in between the ```     ``` markers)

Additional information

Add any other context about the problem here.

aguiteras commented 3 years ago

Solved! Was added in bad way in default.conf.

Regards!