Hi,
I was trying to achieve for following url using nginx.
https://localhost/xyz/d/_0uzUTWZZw/message?orgId=1
if such url requested contains string orgId then set some value to variable.
https://localhost/xyz/d/_0uzUTWZZw/message?orgId=1&var-id=2
if such url requested contains string var-id then set another value to variable.
location /xyz/ {
if ($request_uri ~* “/xyz/.+?orgId”){
set $xyzuser TestingAuthUser1;
}
if ($request_uri ~* “/xyz/.+?orgId.+var-Id”){
set $xyzuser TestingAuthUser2;
}
proxy_set_header X-WEBAUTH-USER “${xyzuser}”;
}
How can I achieve this scenario in nginx. Please suggest.