I am trying to route traffic between multiple upstream servers on nginx as follows:
upstream app_a { server unix:/tmp/app_a.sock fail_timeout=10;
Unfortunately, applications do not know the full uri and expect to sit at the root, which means that I need to rewrite uri when passing to the application, so I thought this might work:
location ~ ^/app_a/(.*)$ { try_files $1 @proxy_to_app_a; }
the application works fine if the location is just / (due to the aforementioned root problem), but this regex-based solution doesn't work. What do I need to do so that the application receives / instead of app_a in the URL?
thanks
source share