Hi,
I have Easy Engine running VPS. I want to enable password protect all my WordPress sites “wp-login.php” as well as “wp-admin” area. To test this process I have added following code to site enabled directory ( /etc/nginx/sites-enabled
) site file (mysite.com
).
location ^~ /wp-login.php { auth_basic “Restricted Area: WordPress”; auth_basic_user_file /var/www/.htpasswd; try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; }
Then I created .htpasswd
file and uploaded to /var/www
directory and set the permission to rw-r-----
.
Then I restarted php and nginx with service php5-fpm reload && service nginx reload
command. Now when I try access /wp-login.php nothing changed. It’s just like the regular login page and not promote any password popup window.
Could someone please tell me how do I fix this issue?