Nginx – Passenger + Nginx on ubuntu 18.04

nginxphusion-passengerubuntu-18.04

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

Best Answer

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.