Phusion Passenger + NGinx with Rails 3
indexI am trying to deploy a simple Rails 3 app on a AWS EC2 with a Ubuntu 12.04 64 bit AMI. I followed the steps in the Phusion Passenger NGinx install page. I also used RVM which was installed successfully.
My steps:
Added the following config section to the nginx.conf
server {
listen 80;
server_name localhost;
root /home/ubuntu/passenger_test/public;
passenger_enabled on
}
I restarted nginx and the rails default public/index.html default rails page shows up but the rails.png doesn't render and "view your application's enviroment" link does not work. I have tried four different times on four fresh new server and always get the same result. Please help!
Ok. Just tried Ubuntu 11.10 t1.micro and got same error. Also tried Ubuntu 11.10 on a m1.small which was somewhat successful. This time got a 404 on the rails.png which what I think is normal in the production environment. Tried changing my rack/rails environment in my nginx.conf file as described here: http://www.modrails.com/documentation/Users%20guide%20Nginx.html#deploying_a_rack_app but got 500 server errors. Tried many other combination with changing the environment but still 500. Found out that if you set bot the rack_env and rails_env config option it complains about duplicate rails_env node. So went back to production and will try with a real rails app tomorrow.
ps The only other step I did differently on the m1.small is that I installed only rails after I ran passenger-install-nginx-module. Once NGinx and Passenger where installed and before I installed Rails I tested a simple Rack app as described here: http://www.modrails.com/documentation/Users%20guide%20Nginx.html#deploying_a_rack_app and it worked!
链接地址: http://www.djcxy.com/p/32484.html上一篇: 403使用nginx +导轨+乘客时禁止