set $auth "Restricted";
if ($request_uri = /xxxxx) {
set $auth off;
}
あとはlocationで認証をかけたいディレクトリに下記を記述
auth_basic $auth;
auth_basic_user_file /etc/nginx/.htpasswd;
WEB制作に必要な技術のメモ
set $auth "Restricted";
if ($request_uri = /xxxxx) {
set $auth off;
}
あとはlocationで認証をかけたいディレクトリに下記を記述
auth_basic $auth;
auth_basic_user_file /etc/nginx/.htpasswd;