So, i wanted to protect /wp-admin/ and wp-login.php of my wordpress installations usng HTTP basic authentication in Nginx.
After feeling around for quite some time, I came with code that I have added to nginx.ssl.conf_ of my websites.
location = /wp-login.php {
auth_basic "Restricted Area: WordPress";
auth_basic_user_file bloup;
include fastcgi_params;
try_files $uri @fallback;
}
location /wp-admin/ {
auth_basic "Restricted Area: WordPress";
auth_basic_user_file bloup;
include fastcgi_params;
try_files $uri @fallback;
}
Is it the right way to do it? Did i miss something?