I have an Apache2 & Passenger site for Rails app, that uses following configuration:
ServerName localhost
DocumentRoot /var/www/
Passenger author here. There is no equivalent for 'AllowOverride all' in Nginx, and you don't need it either. All you need is a virtual host block with the 'root' pointing to your app's 'public' directory, and 'passenger_enabled on':
server {
listen 80;
server_name www.example.com;
root /var/www/site/public;
passenger_enabled on;
}
...as explained by the official Passenger documentation's deployment instructions.
passenger_app_root
and passenger_document_root
are automatically inferred for you from root
. There is no need for try_files
either because Passenger automatically serves static files for you through Nginx.
You should read the official documentation.