Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: how to deny access to wordpress wp-admin pages

$
0
0
hi it is the solution for this question either you call jail wp-admin and wp-login php or any kind of php in wp-admin will not be allowed

location /wp-admin {
allow 1.1.1.1; #your home static ip address
deny all;
error_page 403 = @goawaywpadmin;
}
location @goawaywpadmin {
return 404;
}

location ~ ^/(wp-login.php) {
allow 1.1.1.1; #your home static ip address
deny all;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/aussie/www$fastcgi_script_name;
include fastcgi_params;
error_page 403 = @goaway;
}
location @goaway {
return 404;
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>