I have htpasswd Authentication working for some directorys. In the htpasswd File, i have several Accounts. I want to use the same htpasswd File for all Directorys with the same file. But for some directorys, i want to allow only one specific User from this htpasswd file. But, if i use a construct like:
location ~ ^/somedir/ {
auth_basic "Restricted Directory";
auth_basic_user_file /etc/nginx/.htpasswd;
if ($remote_user != "adminuser")
{
return 403;
}
}
im allways denied to access the directory. No Credential Request is shown.
What can i do?
location ~ ^/somedir/ {
auth_basic "Restricted Directory";
auth_basic_user_file /etc/nginx/.htpasswd;
if ($remote_user != "adminuser")
{
return 403;
}
}
im allways denied to access the directory. No Credential Request is shown.
What can i do?