Hello,
i am trying to use mod_proxy_ajp to route to a tomcat jruby install
located
at /myapp. When doing this
ProxyPass / ajp://localhost:8009/myapp
I get the error "No route matches “/myapp/session/new” with {:method
=>
:get}
I am not sure if there is a cleaner way to route this through AJP (since
this works fine when going to http://localhost:8080/myapp) or if I need
to
tell rails it lives under /myapp/. Any suggestions on how to best
handle
the routing here ?
Hello,
i am trying to use mod_proxy_ajp to route to a tomcat jruby install located
at /myapp. When doing this
ProxyPass / ajp://localhost:8009/myapp
I get the error "No route matches “/myapp/session/new” with {:method =>
:get}
I am not sure if there is a cleaner way to route this through AJP (since
this works fine when going to http://localhost:8080/myapp) or if I need to
tell rails it lives under /myapp/. Any suggestions on how to best handle
the routing here ?
I haven’t done any ajp-based mounting of Rails apps yet. Rails has
this environment variable ENV[‘RAILS_RELATIVE_URL_ROOT’] which is used
for situations like this. JRuby-Rack sets this up for you based on the
value of HttpServletRequest.getContextRoot, but maybe for some reason
that value is not getting transmitted properly with AJP? You could
play around with it by doing something like this in your
environment.rb:
ActionController::Dispatcher.before_dispatch do
puts “Before: #{ENV[‘RAILS_RELATIVE_URL_ROOT’]}”
ENV[‘RAILS_RELATIVE_URL_ROOT’] = “/myapp” # play around with other
values here
end
/Nick
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.