rather, $request_uriby halfpastjohn - Nginx Mailing List - English
Also - our standardization is not the greatest, so I actually want to rewrite the entire URI, which is why I have ^/(.*) as the regex. However I don't think the $1 in the replacement string will still apply to the original URI. Would this work? location ~* /v1/device/(.*)/ { rewrite $uri /api/v1.0/download/$1 break; proxy_pass http://api.domain.com; }by halfpastjohn - Nginx Mailing List - English
I'm trying to setup rewrites so I can automate this more efficiently. Some of my locations require a rewrite and some do not. I currently have it hardcoded into the proxy_pass: location ~* /v1/device/(.*)/ { proxy_pass http://api.domain.com/api/v1.0/download/$1; } Would this accomplish the same thing? location ~* /v1/device/(.*)/ { rewrite ^/(.*) /api/v1.0/download/$1 breakby halfpastjohn - Nginx Mailing List - English
Can i have two, identical, server hostnames in an upstream, with one of them marked as "down"? Like this: resolver 10.0.0.8; upstream backend { server backend.example.com down resolve; server backend.example.com/api/v2/; } The reason being is that i need to route to the second one (with the longer path), but i also need to resolve the hostname. Unfortunately it won'by halfpastjohn - Nginx Mailing List - English
Would this work? location ~ ^/users/v2/ { proxy_pass http://app.domain.com/api/$1/v2; } Would $1 resolve as users or does it need to be inside ()?by halfpastjohn - Nginx Mailing List - English
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 //v2/ { proxy_pass http://app.domain.com/api//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/ {by halfpastjohn - Nginx Mailing List - English
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? Request: https://api.domain.com//v2/ Upstream: https://app.domain.com/api//v2/ I this case, I want to take from the request and populate it into the corresponding of the upstream path. Thanksby halfpastjohn - Nginx Mailing List - English