Problem with starting nginx in Ubuntu 16.04

June 9, 2016 23.1k views
Deployment Nginx Ruby Ruby on Rails

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.


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

Have another answer? Share your knowledge.