ファイル指定で、Basic認証
location ~ /readme.html {
auth_basic_user_file /etc/.htpasswd;
auth_basic "Please enter your ID and password";
}
| プレフィックス | 説明 |
|---|---|
| なし | 前方一致 |
| ^~ | 前方一致。一致したら、正規表現の条件を評価しない。 |
| = | 完全一致。パスが等しい場合。 |
| ~ | 正規表現(大文字・小文字を区別する) |
| ~* | 正規表現(大文字・小文字を区別しない) |
location /data/ {
auth_basic_user_file /etc/.htpasswd;
auth_basic "Please enter your ID and password";
}