I want to make request url to lowercase before setting it for proxy pass.
here is my nginx file
location ^~ /admin/(?<endpath>.*)
{
set_by_lua ngx.var.endpath string.lower(ngx.var.endpath)
proxy_pass http://api.sample.com/api/portal/admin/$endpath$is_args$args;
}
But I am getting error: invalid variable name "ngx.var.endpath"