I have an Apache2 & Passenger site for Rails app, that uses following configuration:
ServerName localhost
DocumentRoot /var/www/
The accepted answer was more related to Passenger documentation. The main reason I stumbled upon this thread is that I was looking to migrate Allow Override setting of .htaccess to nginx.conf.
If you don't know much about nginx you would assume(as I did) that there must be a way to have nginx.conf per directory basis just like we have in Apache.
But that's not the way nginx implemented its settings system and the reason is that structure-wise they find central configurations better instead of having settings scattered over multiple files(.htaccess) making it tough to know the settings effective.
So, to migrating your settings from a .htaccess file, one has to copy those settings(equivalent syntax of nginx) over to single nginx.conf Server{...} block.
Reference links:
https://www.nginx.com/blog/converting-apache-to-nginx-rewrite-rules/
https://www.digitalocean.com/community/tutorials/how-to-migrate-from-an-apache-web-server-to-nginx-on-an-ubuntu-vps