Folks
I Am trying to set up ruby on rails 3.2.3 with passenger 3.0.12 and nginx 1.2. I have followed instructions to compile nginx with passenger module. Following is my nginx configuration. When I try to go to the root page (using curl localhost), it gives me 403 forbidden error. It does not seem to pass the request on to passenger. Let me know if I am missing something simple. Thank you,
worker_processes 1;
events {
worker_connections 1024;
}
http {
passenger_root /home/ubuntu/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12;
passenger_ruby /home/ubuntu/.rvm/wrappers/ruby-1.9.3-p194/ruby;
rails_env development;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
passenger_enabled on;
location / {
root /home/ubuntu/rails/myapp/public;
}
}
}
EDIT
If I do the following:
1) create a new app – dummy
2) Change the config.ru to print ‘hello world’
3) change the root to point to dummy app’s public directory
Then the error goes away.
Also, if I create a brand new rails app, I am able to access the default rails app page. I have also tried to make directory perms 777 for the entire myapp directory structure. No joy.
Solved it.The passenger_enabled clause has to be moved to within the location block.