nginx (Passenger nginx version) で BASIC 認証 - milk1000cc
あとは、/opt/nginx/conf/nginx.conf の server ブロックを以下のような感じで設定します。
... http { ... server { listen 80; server_name www.example.com; root /home/foo/example/public; location / { passenger_enabled on; auth_basic "Restricted"; auth_basic_user_file htpasswd; } } ... } ...
via d.hatena.ne.jp
パスワードファイルはapacheのhtpasswdで作るらしい。