Hi list,
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
{
/abc/bla/ host01;
/xyz/bla/ host02;
}
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;
proxy_pass http://$upstream:8080;
}
Cheers,
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx