lundi 11 mai 2015

nginx and passenger to run my rails application

I'm new to Rails and trying to deploy my rails app (which runs perfectly on my computer using rails server) on to a server.

My server has nginx and passenger both installed and working fine. However, when I change the nginx config file at /opt/nginx/conf/nginx.conf as follows

....
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby1.9.1;
....
server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;                                                                                                                                                                                    

    #access_log  logs/host.access.log  main;                                                                                                                                                            

    location / {
        root   /home/path_to_my_app/public;
        index  index.html index.htm;
    }

    passenger_enabled on;
}

it doesn't work. I'm not able to call my rails code. It keeps saying 404 error.

I restarted the nginx using service nginx restart which returned OK, but still no luck.

Can anyone tell how to debug this. Where should I check what all applications my passenger is running? What is the part I'm missing?

EDIT: I'm following this documentation very closely

Aucun commentaire:

Enregistrer un commentaire