Reinis Rozitis
October 03, 2017 12:12PM
> 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;
> }

Well in general it's something like:

location ~ ^/(.*)/v2/ {
proxy_pass http://app.domain.com/api/$1/v2;
}

Depending on if there are other url parts and/or variables the other way
would be just to use rewrite within matching location block (or just globaly
if every request is proxied). For example:

location /users/v2/ {
rewrite ^/(.*)/v2/ /api/$1/v2 break;
proxy_pass http://app.domain.com;
}


rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to grab a value from a request

halfpastjohn October 02, 2017 06:23PM

Re: How to grab a value from a request

Francis Daly October 02, 2017 07:44PM

Re: How to grab a value from a request

halfpastjohn October 03, 2017 11:29AM

Re: How to grab a value from a request

Reinis Rozitis October 03, 2017 12:12PM

Re: How to grab a value from a request

halfpastjohn October 03, 2017 01:41PM

Re: How to grab a value from a request

Reinis Rozitis October 04, 2017 11:52AM

Re: How to grab a value from a request

Francis Daly October 04, 2017 03:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 206
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready