Problem with starting nginx in Ubuntu 16.04

Posted June 9, 2016 25.5k views
Ruby on RailsNginxRubyDeployment

We have installed Ubuntu 16.04 on our server and almost everything is done. When we try to start nginx, we get this error: Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.

Could you please help us to solve this issue. We have been searching for hours with no luck.

It looks like Passenger isn’t bundled into your Nginx configuration

We are running run Ruby on rails.


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

You’ll need to install a version of Nginx that includes passenger. This can mean compiling Nginx yourself or using a binary package that includes passenger support.

  • @gparent Thanks for your reply.

    I am new when it comes to these server stuff. Could you please show me how to do it or if there is a command or tutorial, I would appreciate it much



The following guide should provide you with a simplified way of installing Ruby, Passenger and NGINX with minimal hassle.

by Etel Sverdlov
This tutorial explains how to install Ruby, how to install any required dependancies, how to install Ruby Gems, how to install Rails, how to install Phusion Passenger, and how to use Passenger to install nginx. Passenger is an app server that allows you to deploy your rails application in production. This tutorial describes how to run Rails with nginx using passenger.

I had same problem after upgrading Ubuntu to 16.. solution was to fix paths in file:

sudo vi /lib/systemd/system/nginx.service

to: “/opt/nginx/sbin/nginx”

and after “systemctl daemon-reload” everthing worked