Topic: Rails app inside another SSL Rails app

Hello all.

We currently have a production rails 3 site running using phusion passenger. It is running on SSL.

However our client also wants a test site and it must also use SSL. We do not have the time, free IPs or money to setup a separate SSL app on a different sub-domain so I have been told to try and put a clone of the main app under the /test path.

My first thought was to setup the test app on a different port and reverse proxy to it inside a location directive of the main site's virtual host.

  <LocationMatch "/test.*">
     ProxyPassMatch http://xxx.xxx.xxx.xxx:8080/test/$1
     ProxyPassReverse http://xxx.xxx.xxx.xxx:8080/test/$1
  </LocationMatch>

However this does not appear to work correctly.  I believe that the test app's generated urls always cut off the /
(I haven't been able to access the app proper since I cannot login beause of the redirect to the slash'less route and accessing the correct route still results in a redirect)

http://www.site.comtest

Because this is a Rails 3 app I cannot use the config.action_controller.relative_url_root (or whatever it was) so I am, for the moment just sticking all the routes inside a large

scope '/test' do
...routes here...
end

If anyone has any experience or suggestions on how to proceed they would be most appreciated, I am not an apache expert and have never had to do this (frankly PITA) setup before.

Note that I cannot use a self-signed cert on a separate subdomain; the only option available is to stick the test applicaton in the /test path/

cheers

RJ

EDIT: I have tried every method on this page without success
http://stackoverflow.com/questions/3181 … e-url-root


EDIT: I am pretty sure the apache config is ok, it is just why the "#$!% rails app urls are missing the /

trying to access

https://www.site.com/test/user/login

ends up with a redirect to

https://www.site.comtest/user/login

This URL is being generated by a before_filter pointing to a devise login route

Last edited by RurouniJones (2011-04-13 22:01:52)

Re: Rails app inside another SSL Rails app

After some discussion on the phusion passenger mailing list a nice solution was found.

https://groups.google.com/group/phusion … aa0637b46d for more information