How to grab a value from a request

halfpastjohn nginx-forum at forum.nginx.org
Tue Oct 3 15:29:44 UTC 2017


I'm sorry i don't quite follow. How is your example using the map directive?
Just for clarity, here is what I'm trying to do.

location /[resource]/v2/  {
    proxy_pass http://app.domain.com/api/[resource]/v2;
}

In fact, the location bit will be hardcoded with the actual resource, I just
need the proxy_pass to grab that value and pop it into its path. So more
something like this:

location /users/v2/  {
    proxy_pass http://app.domain.com/api/{{users}}/v2;
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,276652,276661#msg-276661



More information about the nginx mailing list