There are tons of bot request to my WP site via url wp-login.php?action=register
to create trash users. I want to block all of them using Nginx
I has tried applying below conf following this post https://stackoverflow.com/a/48614915/6563638
location = /wp-login.php {
if ( $args ~ ^action=register ) {
return 403;
}
}
location / {
try_files $uri $uri/ /index.php?$args;
}
All requests to wp-login.php?action=register
has successfully returned with 403. But now other requests to wp-login.php
are being file downloading requests at all. I can't pass them to PHP CGI to execute.
Anyone got solution for this issue?