- NGINX Cookbook
- Tim Butler
- 118字
- 2025-04-04 18:27:16
How it works...
There are a number of directives which aren't seen elsewhere because this recipe uses a specific Passenger module. In the core NGINX configuration file, we set the generic Passenger variables to use the correct Ruby version as well as the user which will run the Passenger server.
In our server block directive, we point Passenger to our demo Rails instance and enable Passenger for the server instance. There's also a basic assets location block directive, so that NGINX will process the static media natively.
Lastly, we call passenger_pre_start to automatically start the Passenger application server when NGINX starts. This saves you having to start it separately, as is the case for most other application servers.