wordpress - Restricting access to files and directories on Nginx by IP -
i'm trying lock down access wp-admin using ip restrictions on nginx. following seems block wp-admin, doesn't block wp-login.php
this start stop being able login other ip, after signing in redirected wp-admin restricted. however, can still sign in form , in theory still affected brute force attacks.
server { listen 80; server_name website.com www.website.com dev.website.com; location / { root /var/www/html/website.com/; index index.php index.html index.htm; try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { root /var/www/html/website.com/; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param script_filename $document_root$fastcgi_script_name; include fastcgi_params; } location ~ ^/(wp-admin|wp-login/.php) { root /var/www/html/website.com/; index index.php index.html index.htm; allow 123.123.123.123/32; deny all; } }
if fix context might fix issue. instead of forward slash backslash prior .php
location ~ ^/(wp-admin|wp-login\.php) { allow 123.123.123.123/32; deny all; }
Comments
Post a Comment