I use nginx as a reverse proxy for multiple Rails apps (using Nixy). I need to rewrite some requests to inject a string in front of url, if is missing.
For example:
If I have http://proxy_ip/app_name/some/root
I don't want to modify anything, but if I have http://proxy_ip/some/root
I want to transform in http://proxy_ip/app_name/some/root
I tried rewrite ^ /app_name/$uri;
but it doesn't work, and I have no idea how to conditionally do that rewrite.