When you deploy a Rails application using Capistrano the application runs in production mode by default and you don't normally have to worry about it. But what happens when you are taking advantage of Capistrano multistage to set up multiple environments? How do you set the environment your application will run on?
The answer is in the virtual host definition in your web server. In Apache you do:
RailsEnv = staging
In Nginx is slightly different: