Answer the question
In order to leave comments, you need to log in
How to ban bots using nginx?
Hello. You need to ban bots using nginx.
Inserted the following lines in the file
:
include custom/bad_ua;
include custom/bad_referer;
include custom/bad_ip;
include custom/bad_location;
Answer the question
In order to leave comments, you need to log in
In general, in the include directive, you need to write the file name with the extension. Those. if you plan to name the file bad_ua.conf, then you need to write include custom/bad_ua.conf in the config.
And in these files, you need not just to list refreers or IPs, but to prescribe nginx rules.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question