Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do you need nginx with passenger for RoR?

I know that nginx is a web server, and passenger is an app server. We can just run

passenger start

to start up our rails application, and everything seems to work fine. But there are a lot of posts about setting up nginx as a reverse proxy.

It would be helpful if an expert on this broke down each component, and explain why need nginx and passenger together, and the role of each.

Questions for thought:
- What is the main purpose of wrapping the passenger around nginx, as opposed to running passenger standalone?
- Is it bad to just run passenger standalone?
- Does running "passenger start" boot up its own nginx server?

like image 713
hackstar15 Avatar asked Sep 26 '15 19:09

hackstar15


1 Answers

All your questions are answered in the official Passenger documentation.

  • Why Passenger is needed, and how it relates to Nginx, and how Passenger fits relative to the rest of the stack: Fundamental Concepts
  • How Passenger Standalone is different from Passenger for Nginx: Integration modes
  • Is it bad to just run passenger standalone? No, as described in Integration modes
  • Does running "passenger start" boot up its own nginx server? Yes, by default. Passenger Standalone also has a "builtin" engine that does not boot up an Nginx server, for specialized configurations: https://www.phusionpassenger.com/library/config/nginx/optimization/#switching-to-passenger-standalone-with-the-builtin-http-engine
like image 132
Hongli Avatar answered Nov 14 '22 08:11

Hongli