NginxでBasic認証

location  /  {
  auth_basic            "Restricted";
  auth_basic_user_file  htpasswd;
}

参考

http://wiki.nginx.org/HttpAuthBasicModule