T
T
TopGun892017-07-18 15:18:21
Nginx
TopGun89, 2017-07-18 15:18:21

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;

Question:
The next step is to create a custom directory, put the bad_ua, bad_referer, bad_ip, bad_location files into it?
bad_ua, etc. are these files with .conf extension? Those file will look like bad_ua.conf ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
4
4X_Pro, 2017-07-18
@TopGun89

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.

V
Vladimir, 2017-07-20
@ruvasik

A little too radical.
I would suggest something like fail2ban)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question