Why do you need nginx with a passenger for RoR?

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

passenger start 

to run our rails app and everything works fine. But there are many posts about setting up nginx as a reverse proxy.

It would be useful if an expert on this broke each component and explained why nginx and the passenger are needed together, and the role of each.

Questions for reflection:
- What is the main purpose of wrapping a passenger around nginx, as opposed to launching an autonomous passenger?
- Is it bad to just drive a passenger separately?
- Does launching a "passenger" start its own nginx server?

+5
source share
2 answers

All your questions are answered in the official documentation for passengers.

+5
source

I am not a web server expert, although I always deploy my Rails applications using Passenger for Apache / Nginx.

Let me just list a few advantages of this approach (maybe it will have more options and reasons):

  • Passenger is a standalone server. This means that it is designed to work on a single machine. You cannot balance the operation of two passenger servers as you can with Apache / Nginx.
  • You can run only one application on this machine using Passenger.
  • Static asset management can be done using Nginx without hitting passengers.
  • It is very easy for an attacker to make your site immune by sending too many requests. Nginx / Apache allows you to block specific IP s.
0
source

Source: https://habr.com/ru/post/1232366/


All Articles