Using map and proxy_pass
markus.jelsma at openindex.io
Fri Apr 29 19:45:51 MSD 2011
I'm pulling my hair out. I need to pass to different proxies based on the
first uri segment but don't seem be able to get it working.
I have the following map:
map $uri $upstream
Originally i tried using regex in the uri because different 2nd segments can
be used, doing /abx/(.*)/ doesn't work either, or i'm using it the wrong way.
So for now i'm trying with fixed uri's.
In the location handling the 2nd segment i rewrite and proxy_pass.
location ~ "/(.*)/abc"
rewrite ^(.*)$ /another_segment$1 break;
More information about the nginx