404 Not Found error in deploying rails 3.2.12 app (with engines) to SUB URI on nginx/passenger

前端 未结 2 913
误落风尘
误落风尘 2021-01-13 21:30

We need to deploy a rails 3.2.12 app to sub uri nbhy on a ubuntu 12.04 server. The rails app has 3 engines a

相关标签:
2条回答
  • 2021-01-13 21:51

    Most likely the authentify engine is doing a redirect to /user_menus, instead of /nbhy/authentify. Is this a custom Rails or Sinatra app that you have written? If so, you need to change/configure the code of authentify to always append the current subdirectory under which the Rails app is hosted. You can get that from passenger by saying ENV['RAILS_RELATIVE_URL_ROOT'] in your code.

    0 讨论(0)
  • 2021-01-13 22:07

    Rails is generating paths straight from http://6.95.225.93 instead of http://6.95.225.93/nbhy.

    You probably need to scope all your routes to "/nbhy".

    config/routes.rb

    scope "/nbhy" do
      ...
    end
    
    0 讨论(0)
提交回复
热议问题