Sometimes you may want to lock specific directory on your ningx server with a password to improve security. For example, you may want to lock your wp-admin directory of your WordPress installation with a password.
Prerequisites
To enable HTTP Authentication with nginx on Debian, you?ll need to have a VPS with root access and nginx server installed in it.