M
M
modxyou2018-03-06 13:03:38
Nginx
modxyou, 2018-03-06 13:03:38

How to block access to the Wordpress admin panel on Nginx?

Good afternoon!
Site on Wordpress.
FastCGI (Nginx + PHP-FPM) is used.
I want to close access to the admin panel completely, with permission from one IP.
I add this structure:

location /wp-login.php {
allow 0.0.0.0;
deny all;
}

When I try to log in to the admin panel, the /wp-login.php file is downloaded
Please tell me how can I fix this?
Thanks a lot

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2018-03-06
@ky0

Well, of course - in your "construction" nothing is said about which interpreter to process wp-login.php.
To open access only from certain addresses, you need not add 0.0.0.0 to allow, but these same addresses.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question