A
A
Alexander2020-06-14 23:25:15
Nginx
Alexander, 2020-06-14 23:25:15

How to deny access to a file by pattern in NGINX?

Now it is written in the site config like this

location ~* wp-config.php {
      deny all;
    }

How to deny access to all files starting with "wp-config"?
Because bots access such addresses
/wp-config.php.new
~ /wp-config.php.!
/wp-config.php.private
/wp-config.php.private
etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-06-14
@dodo512

location ~ /wp-config {
    deny all;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question