I've seen a lot of bruce force attacks on Wordpress, so I want to limit access to wp-login.php. It's the latest Wordpress on a Ubuntu 16.04LTS Nginx server with PHP-FPM.

I've tried the advice from the Wordpress Codex:

location /wp-admin {
  allow   x.x.x.x;
  deny    all;

But that doesn't seem to work. It only blocks /wp-admin, but allows /wp-admin/index.php


Block it recursive beginning with the /wp-admin directory

location ^~ /wp-admin {
  allow x.x.x.x;
  deny all;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.