I'm trying to setup a server for a Sinatra application with Apache and Phusion Passenger.
The catch is, the server is supposed to be served from a sub-URI (say example.com/example), and the base URI (example.com) is served from another machine which just points /example to the server I'm setting up.
I know the usual way of setting up Rack based apps under a sub-URI with Passenger, the RackBaseURI directive and a symlink from the DocumentRoot with the same name as the sub-URI, but his assumes the base-URI point to another site you are running on the same machine. I have successfully set this up on a test server.
But I just can't get Passenger to tell Sinatra that it runs under example.com/example, so all links (using the url() helper) are still generated as e.g. example.com/images rather than example.com/example/images.
Is there another way of doing this other than through Passenger, like a hidden environment variable or something? I don't want to hard point all my links, because it might get deployed elsewhere in the future. Surely there has to be a better way?