如何隐藏wp-admin AWS NginX

我有一个WordPress的网站,我想限制访问pipe理页面。 服务器位于ELB后面的AWS中。 我在服务器{}之间的.conf文件中设置了位置指令。 我已经设置的configuration不工作,因为我仍然可以从应该被拒绝的IP地址访问页面。

有人可以看看,给一些指导? 谢谢!

location ~ ^/(wp-admin\.php) { real_ip_header X-Forwarded-For; set_real_ip_from xxx.xxx.xxx.xxx; allow xxx.xxx.xxx.xxx; deny all; } 

使用下面的使你的用例工作。

 location ~ ^/(wp-admin|wp-login.php) { real_ip_header X-Forwarded-For; allow xx.xx.xx.xx; deny all; }