Can’t password protect wp-login.php, nothing happened

Solution:

The problem is /wp-login.php already declared inside wpcommon.conf

So, copy /etc/nginx/common/wpcommon.conf to /var/www/example.com/my-wpcommon.conf

Edit this block

location = /wp-login.php {
  limit_req zone=one burst=1 nodelay;
  include fastcgi_params;
  fastcgi_pass php;
}

into

location = /wp-login.php {
  limit_req zone=one burst=1 nodelay;
  include fastcgi_params;
  fastcgi_pass php;

  satisfy any;
  allow 127.0.0.1;
  deny all;
  auth_basic "Authorization Required";
  auth_basic_user_file /var/www/.htpasswd;
}

then edit your site nginx configuration at /etc/nginx/sites-available/example.com, replace

include common/wpcommon.conf;

into

include /var/www/example.com/my-wpcommon.conf;

Restart nginx.

However, please check /etc/nginx/common/wpcommon.conf every time you update your EasyEngine in case of new configuration so your my-wpcommon.conf would still be updated.