title: How to connect a Rails App on one server (DigitalOcean droplet) to a MongoDB server on another server via private connection
body: <p>I'm trying to setup two servers: one for my App and another for my DB (MongoDB). </p>
  
  <p>Each server sits on its own droplet (VPS) and both servers can talk to each other via private network. </p>
  
  <p>I want to completely close my db server off the internet and only allow connections from the private network. </p>
  
  <p>I can connect to the server via <code>ssh</code> tunnel like so: <code>ssh -L 4321:localhost:27017 -i ~/.ssh/id_rsa.pub myuser@myserver_ip</code> but how can I configure Rails/Mongoid to connect to the server the same way (using the private network rather than connect via internet)?</p>
  
  <p>Is it at all possible?</p>