You may get a 403 Forbidden
error code for a Rails 2.3 application under Phusion Passenger 5. And the corresponding error message in the log is similar to Directory index forbidden by Options directive: /webapps/xxxxxx/current/public/
. Well, the cause of this error may be totally unrelated to the Options
directive in httpd.conf
.
This error may be caused by a change in the support of Rails 2.3 applications in Passenger 5: You are required to add a config.ru
file to the root directory of a Rails 2.3 application. Here is an example from the reference below:
-
# Require your environment file to bootstrap Rails
-
require ::File.dirname(__FILE__) + '/config/environment'
-
-
# Serve static assets from RAILS_ROOT/public directory
-
# use Rails::Rack::Static
-
# Dispatch the request
-
run ActionController::Dispatcher.new
Reference: https://blog.phusion.nl/2015/03/04/phusion-passenger-5-0-1-released/#rails_2_3.
Post new comment