I have a scenario today where I have an apache with mod_jk balancing requests to JBoss cluster. In this configuration I have some rewrite rules to remove the context root of the url. EX:
URL request: www.example.com Rewrites to: www.example.com/app1 With that mod_jk forwards the request to JBoss, post processed, it rewrites the URL again: www.example.com/
Then the user will always see the URL without the context root, while in fact the application works with the context in internal servers.
I can not think of how to put these rules in Nginx. Any suggestions?