Hi,
I’ve created the main site with ee site create example.com --mysql.
Then later I decided to add blog to this domain under example.com/blog . I’ve manually installed WP into this folder. I use this config and it works fine:
location /blog {
index index.php;
try_files $uri $uri/ /blog/index.php;
}
Now I want to protect wp-login.php in /blog folder with HTTP authentification but it doesn’t work.
I’ve tried tons of combinations but none of them works . The last one I’ve tried was:
location ~* (wp-admin|wp-login.php) {
auth_basic "Authorization Required";
auth_basic_user_file /var/www/example.com/.htpasswd;
}
The interesting part is that password protection with the location block mentioned above works for wp-admin folder but it ignores the wp-login.php (no HTTP authentication dialog will appear)
Seems that wp-login.php file is handled also somewhere else but I cant find it. WP specific config files were not included into Nginx config as I didn’t create this blog with ee only the main domain.
Any suggestion ?