Hi ,
I am trying to setup different authentication based on different strings in the $request , here is my case .
location /parent/ {
set $basic_file /nginx/conf/.htpasswd;
if ($request_uri ~ (visualize|dashboard|settings)){
set $basic_file /nginx/conf/.dev_pass;
}
proxy_pass http://<some ip and port >/;
auth_basic "Restricted";
auth_basic_user_file $basic_file;
}
I would like file .htpasswd to be used by default and in case of $request_uri having (visualize|dashboard|settings) , auth should happen via .dev_pass .
For some reason the authentication is happening only via htpasswd even if i have (visualize|dashboard|settings) in the URI .
Any idea , what am i missing?