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

[INSTALLATION] (followed step by step, cannot configure nginx.conf correctly] #452

Open bulbulbul42 opened 2 years ago

bulbulbul42 commented 2 years ago

hello guys, i followed guide step by step. everything went fine until the last part.

the installer doesn't include this lines in the nginx.conf file (step 5)

include /etc/nginx/bots.d/ddos.conf; include /etc/nginx/bots.d/blockbots.conf;

when i try to add it manually, it gives me this error

@@@@@@@@@@@/usr/local/sbin$ sudo nginx -t 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

any help would be appreciated because i couldn't troubleshoot it all day :(

do I need includes in the main conf file? without them it seems its not blocking the requests

P.S. I'm using lets encrypt SSL, is there I should have done diffidently?

L8X commented 1 year ago

Bump @mitchellkrogza

magefan commented 6 months ago

@L8X , @bulbulbul42 , we get into the same issue. The problem was that in one of virtual host configuration files these linces

include /etc/nginx/bots.d/ddos.conf;
include /etc/nginx/bots.d/blockbots.conf;

where added in a wrong place, so just edited the virtual host config and move the include to a proper position.