On Mon, Oct 02, 2017 at 06:23:37PM -0400, halfpastjohn wrote:

Hi there,

> I'm setting up nginx as a proxy router for various APIs. How can I take a
> specific value form the incoming request and dynamically populate it into
> the upstream?

In general, you can use map (http://nginx.org/r/map) with named regex captures.

In this specific case:

> Request: https://api.domain.com/[resource]/v2/
> Upstream: https://app.domain.com/api/[resource]/v2/

  location / { proxy_pass https://app.domain.com/api/; }

might do exactly what you want.

        f
-- 
Francis Daly        fran...@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to