gem version

Introduction to configuring Passenger

Relevant selection for this article:

Nginx

Passenger in its Nginx integration mode is to be configured via the Nginx configuration file. There is no configuration file that is specific to Passenger only.

If you have used Passenger Standalone, then you may be familiar with Passengerfile.json. Passenger for Nginx does not consult Passengerfile.json, only the Nginx configuration file.

The articles mentioned above require you to select standalone as the selected integration mode.

Configuring Passenger for Nginx works as follows:

  1. During the Passenger installation process, an Nginx binary with the Passenger module compiled in, is installed.
  2. The Passenger Nginx module registers Passenger-specific configuration options inside Nginx.
  3. You, the administrator, configure Passenger by adding Passenger-specific configuration options to the Nginx configuration file.
  4. Restart or reload Nginx to apply any configuration changes.

Here is an example of an Nginx configuration file which also configures Passenger:

server {
    server_name yourserver.com;
    root /var/www/myapp/code/public;
    passenger_enabled on;
    passenger_ruby /usr/bin/ruby2.0;
    passenger_sticky_sessions on;
}

Essential configuration

For Passenger to work, only two configuration options need to be setup in Nginx, namely passenger_enabled and passenger_root. If you have already gone through the installation process, then it has already been set.

Start configuring Passenger

Passenger provides a wide range of features and customization options. Some of them are for improving or tweaking the application's performance characteristics, some of them influence application or connection handling behavior, etc. Please visit the configuration index page to learn what you can configure.

light mode dark mode
Passenger 6 Passenger 6