I am trying to setup new server, but nginx is unable to load directive "passenger_enabled".

May 03 11:35:28 xxxx nginx[11181]: nginx: [emerg] unknown directive "passenger_enabled" in /etc/nginx/sites-enabled/default:25
May 03 11:35:28 xxxx nginx[11181]: nginx: configuration file /etc/nginx/nginx.conf test failed

I think I installed it right:

dorijan@xxxxxx:/etc/nginx/sites-enabled$ sudo apt-get install -y nginx-extras passenger
Reading package lists... Done
Building dependency tree
Reading state information... Done
nginx-extras is already the newest version (1.14.0-0ubuntu1).
passenger is already the newest version (5.0.30-1build2).

in nginx.conf I have

... include /etc/nginx/conf.d/.conf; include /etc/nginx/sites-enabled/; include /etc/nginx/passenger.conf; ...

and /etc/nginx/passenger.conf contains:

dorijan@xxxxxx:/etc/nginx$ cat passenger.conf
passenger_ruby /home/dorijan/.rvm/wrappers/ruby-2.5.0/ruby;
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;

and default site configuration is:

    server {
            listen 80 default_server;
            listen [::]:80 default_server;
            server_name xxxx.local;
            passenger_enabled on;
            rails_env    development;
            root /home/dorijan/ruby/xxxxx/public;

Any idea what is wrong? Thank you


I guess there is no nginx package with a passenger module in the bionic repositores yet, right? You might want to check if the module is included in your nginx by

nginx -V

I also did not find a suitable libnginx-mod-http-passenger anywhere.

sudo apt install -y nginx

Installing nginx is still needed after following the instructions https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/nginx/oss/bionic/install_passenger.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.