nixCraft published a tutorial about how to password protect directory with Nginx .htpasswd authentication.
How to password protect a directory with Nginx authentication
Explains how to password protect a directory with nginx web server using basic HTTP authentication method and .htpasswd file.
How to password protect a directory with Nginx authentication - nixCraft