Phusion Passenger is currently not serving any applications

后端 未结 2 2164
谎友^
谎友^ 2021-02-20 03:33

I got error like Phusion Passenger is currently not serving any applications. while trying to restart passenger with passenger-config restart-app comm

2条回答
  •  轮回少年
    2021-02-20 03:40

    See my comment here.

    You need to explicitly specify, where actual Ruby code of a Rails application is located, using passenger_app_root directive, described in Passenger's documentaion.

    Without this directive, Passenger will thinck, that actual Ruby code is located in path, specified with root nginx-directive.

    Example of a correct configuration file '/etc/nginx/sites-available/app_name':

    server {
      listen 80;
    
      server_name 188.225.35.216;
      passenger_enabled on;
      rails_env    production;
      root         /path/to/your/app/public/folder;
      passenger_app_root /path/to/your/app/code; # <<< Point Passenger to application code
    
      # redirect server error pages to the static page /50x.html
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
        root   html;
      }
    }
    

    In my case, Passenger was't serving my Rails app, that was deployed with Capistrano. I had have to specify a value for passenger_app_root like following /var/www/my_app/current.

    This will point Passenger exactly, where application code is presented.

提交回复
热议问题