Search code examples
ruby-on-railsrubynginxcentospassenger

Nginx Passenger not serving Rails application


I setup Nginx with passenger on centos 7 VPS. I installed nginx and passenger as a gem. In addition I installed passenger-install-nginx-module. When I start sudo service nginx and type passenger-status I get "Phusion Passenger is currently not serving any applications.". From my nginx conf file

http {
    passenger_root /usr/local/rvm/gems/ruby-2.4.1/gems/passenger-5.1.8;
    passenger_ruby /usr/local/rvm/gems/ruby-2.4.1/wrappers/ruby;
    passenger_app_env production;
    passenger_instance_registry_dir /var/lib/passenger-instreg;

 ...

 server {
        listen       80;
        server_name  localhost;
        root /home/myuserhere/current/public;
        passenger_enabled on;

File passenger.* creates normally when I restart nginx.

echo $PASSENGER_INSTANCE_REGISTRY_DIR returns the same path as in nginx conf file.

What I do wrong that passegner does not start application?


Solution

  • Finally I got it. Everything was all right. Passenger does not start apps during startup, but during the first request so all I needed to do it was press enter in my browser ... Hope that answer save time to others.