Introduction to configuring Passenger + 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.
Configuring Passenger for Nginx works as follows:
- During the Passenger installation process, an Nginx binary with the Passenger module compiled in, is installed.
- The Passenger Nginx module registers Passenger-specific configuration options inside Nginx.
- You, the administrator, configure Passenger by adding Passenger-specific configuration options to the Nginx configuration file.
- 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.