Book Image

NGINX Cookbook

By : Tim Butler
Book Image

NGINX Cookbook

By: Tim Butler

Overview of this book

NGINX Cookbook covers the basics of configuring NGINX as a web server for use with common web frameworks such as WordPress and Ruby on Rails, through to utilization as a reverse proxy. Designed as a go-to reference guide, this book will give you practical answers based on real-world deployments to get you up and running quickly. Recipes have also been provided for multiple SSL configurations, different logging scenarios, practical rewrites, and multiple load balancing scenarios. Advanced topics include covering bandwidth management, Docker container usage, performance tuning, OpenResty, and the NGINX Plus commercial features. By the time you've read this book, you will be able to adapt and use a wide variety of NGINX implementations to solve any problems you have.
Table of Contents (14 chapters)

Running Ruby on Rails with NGINX

Ruby on Rails is a full web application framework, based on the Ruby programming language. As with a more traditional framework such as Django, Rails is based around a standard Model View Controller (MVC) pattern. This makes it well suited to rapid development which is also highly performant and feature packed.

Getting ready

Although there are a number of different application servers for Rails, one of the more popular is Passenger. With the highest performance and great documentation, Passenger's popularity is well deserved. This recipe has been tested with Ruby 2.3, Rails 4.2, and Passenger 5.0.

We can install Passenger via gem:

gem install passenger

To integrate with NGINX, this requires...